提交 2c045835 authored 作者: Noel Grandin's avatar Noel Grandin

some tests were not closing their connections

上级 e96c3246
...@@ -41,6 +41,7 @@ public class TestRowFactory extends TestBase { ...@@ -41,6 +41,7 @@ public class TestRowFactory extends TestBase {
stat.execute("insert into t1 values(" + i + ", 'name')"); stat.execute("insert into t1 values(" + i + ", 'name')");
} }
assertTrue(MyTestRowFactory.COUNTER.get() >= 1000); assertTrue(MyTestRowFactory.COUNTER.get() >= 1000);
conn.close();
deleteDb("rowFactory"); deleteDb("rowFactory");
} }
......
...@@ -345,7 +345,7 @@ public class TestTableEngines extends TestBase { ...@@ -345,7 +345,7 @@ public class TestTableEngines extends TestBase {
return "0".equals(b) && a != null && a < 2; return "0".equals(b) && a != null && a < 2;
} }
}, null); }, null);
conn.close();
deleteDb("tableEngine"); deleteDb("tableEngine");
} }
...@@ -362,6 +362,7 @@ public class TestTableEngines extends TestBase { ...@@ -362,6 +362,7 @@ public class TestTableEngines extends TestBase {
+ "(select id from QUERY_EXPR_TEST)"); + "(select id from QUERY_EXPR_TEST)");
stat.executeQuery("select 1 from QUERY_EXPR_TEST_NO n " stat.executeQuery("select 1 from QUERY_EXPR_TEST_NO n "
+ "where exists(select 1 from QUERY_EXPR_TEST y where y.id = n.id)"); + "where exists(select 1 from QUERY_EXPR_TEST y where y.id = n.id)");
conn.close();
deleteDb("testQueryExpressionFlag"); deleteDb("testQueryExpressionFlag");
} }
...@@ -401,6 +402,7 @@ public class TestTableEngines extends TestBase { ...@@ -401,6 +402,7 @@ public class TestTableEngines extends TestBase {
checkPlan(stat, "select * from (select (select id from test_plan " checkPlan(stat, "select * from (select (select id from test_plan "
+ "where name = 'z') from dual)", + "where name = 'z') from dual)",
"MY_NAME_INDEX"); "MY_NAME_INDEX");
conn.close();
deleteDb("testSubQueryInfo"); deleteDb("testSubQueryInfo");
} }
...@@ -469,6 +471,7 @@ public class TestTableEngines extends TestBase { ...@@ -469,6 +471,7 @@ public class TestTableEngines extends TestBase {
forceJoinOrder(stat, false); forceJoinOrder(stat, false);
TreeSetIndex.exec.shutdownNow(); TreeSetIndex.exec.shutdownNow();
} }
conn.close();
deleteDb("testBatchedJoin"); deleteDb("testBatchedJoin");
} }
......
...@@ -187,6 +187,7 @@ public class TestDataSource extends TestBase { ...@@ -187,6 +187,7 @@ public class TestDataSource extends TestBase {
conn = ds.getConnection(getUser(), getPassword()); conn = ds.getConnection(getUser(), getPassword());
stat = conn.createStatement(); stat = conn.createStatement();
stat.execute("SELECT * FROM DUAL"); stat.execute("SELECT * FROM DUAL");
conn.close();
} }
} }
...@@ -10,7 +10,6 @@ import java.sql.ResultSet; ...@@ -10,7 +10,6 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.Task; import org.h2.util.Task;
...@@ -151,6 +150,7 @@ public class TestMvcc2 extends TestBase { ...@@ -151,6 +150,7 @@ public class TestMvcc2 extends TestBase {
assertThrows(ErrorCode.LOCK_TIMEOUT_1, conn2.createStatement()). assertThrows(ErrorCode.LOCK_TIMEOUT_1, conn2.createStatement()).
execute("select * from test where id = 3 for update"); execute("select * from test where id = 3 for update");
conn.close(); conn.close();
conn2.close();
} }
private void testInsertUpdateRollback() throws SQLException { private void testInsertUpdateRollback() throws SQLException {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论