summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2010-08-25 07:04:47 (EDT)
committerStefan Winkler2010-08-25 07:04:47 (EDT)
commit47bf5c8a42bae9f49cc3c6f9d0ae1c4f50fec4a4 (patch)
treeaf36e95689b001b6e52cf38e1d6cad9f4c602a65
parentad6dac0bb3e79384858de9de389d074d1e80965c (diff)
downloadcdo-47bf5c8a42bae9f49cc3c6f9d0ae1c4f50fec4a4.zip
cdo-47bf5c8a42bae9f49cc3c6f9d0ae1c4f50fec4a4.tar.gz
cdo-47bf5c8a42bae9f49cc3c6f9d0ae1c4f50fec4a4.tar.bz2
[322778] [DB] DatabaseMetaData.getTables hangs/throws when called during test tearDown
https://bugs.eclipse.org/bugs/show_bug.cgi?id=322778
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Derby).launch16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java25
2 files changed, 36 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Derby).launch b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Derby).launch
new file mode 100644
index 0000000..4278ea2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (Derby).launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBDerby.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.db.AllTestsDBDerby"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests.db"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx512m"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java
index f74d9c5..b1e74e9 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.server.internal.db.DBStore;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.ddl.IDBSchema;
import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.util.collection.Pair;
@@ -467,12 +468,26 @@ public class Net4jDBTest extends AbstractCDOTest
store = (DBStore)getRepository().getStore();
connection = store.getConnection();
- prepareTable(tableName);
- writeValues(tableName);
- checkValues(tableName);
+ try
+ {
+ prepareTable(tableName);
+ writeValues(tableName);
+ checkValues(tableName);
- connection = null;
- store = null;
+ }
+ finally
+ {
+ try
+ {
+ connection.commit();
+ }
+ finally
+ {
+ DBUtil.close(connection);
+ connection = null;
+ store = null;
+ }
+ }
}
private void writeTypeValue(ExtendedDataOutputStream outs, DBType type, Object value) throws IOException