提交 010ae270 authored 作者: sugnkeunkim's avatar sugnkeunkim

use different name of db table

上级 9a21ab92
...@@ -22,7 +22,7 @@ import org.h2.api.ErrorCode; ...@@ -22,7 +22,7 @@ import org.h2.api.ErrorCode;
public class TestMvccMultiThreaded2 extends TestBase { public class TestMvccMultiThreaded2 extends TestBase {
private static final AtomicBoolean running = new AtomicBoolean(true); private static final AtomicBoolean running = new AtomicBoolean(true);
private static final String url = "jdbc:h2:mem:qed;MVCC=TRUE;LOCK_TIMEOUT=120000;MULTI_THREADED=TRUE"; private static final String url = ";MVCC=TRUE;LOCK_TIMEOUT=120000;MULTI_THREADED=TRUE";
/** /**
* Run just this test. * Run just this test.
...@@ -47,10 +47,11 @@ public class TestMvccMultiThreaded2 extends TestBase { ...@@ -47,10 +47,11 @@ public class TestMvccMultiThreaded2 extends TestBase {
} }
private void testSelectForUpdateConcurrency() throws SQLException { private void testSelectForUpdateConcurrency() throws SQLException {
Connection conn = getConnection(url); deleteDb(getTestName());
Connection conn = getConnection(getTestName() + url);
conn.setAutoCommit(false); conn.setAutoCommit(false);
String sql = "CREATE TABLE test (" String sql = "CREATE TABLE testmvccmultithreaded2 ("
+ "entity_id INTEGER NOT NULL PRIMARY KEY, " + "entity_id INTEGER NOT NULL PRIMARY KEY, "
+ "lastUpdated INTEGER NOT NULL)"; + "lastUpdated INTEGER NOT NULL)";
...@@ -80,7 +81,7 @@ public class TestMvccMultiThreaded2 extends TestBase { ...@@ -80,7 +81,7 @@ public class TestMvccMultiThreaded2 extends TestBase {
} }
smtm = conn.createStatement(); smtm = conn.createStatement();
smtm.execute("DROP TABLE TEST"); smtm.execute("DROP TABLE testmvccmultithreaded2");
if (conn != null) { if (conn != null) {
try { try {
conn.close(); conn.close();
...@@ -99,7 +100,7 @@ public class TestMvccMultiThreaded2 extends TestBase { ...@@ -99,7 +100,7 @@ public class TestMvccMultiThreaded2 extends TestBase {
Connection conn = null; Connection conn = null;
while(running.get() && !done) { while(running.get() && !done) {
try { try {
conn = getConnection(url); conn = getConnection(getTestName() + url);
conn.setAutoCommit(false); conn.setAutoCommit(false);
PreparedStatement ps = conn.prepareStatement( PreparedStatement ps = conn.prepareStatement(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论