提交 dea4df8f authored 作者: Andrei Tokar's avatar Andrei Tokar

allow for LOCK_MODE=0 & MULTI_THREADED & MVCC=TRUE

上级 c57fb7c9
...@@ -2264,13 +2264,13 @@ public class Database implements DataHandler { ...@@ -2264,13 +2264,13 @@ public class Database implements DataHandler {
public void setLockMode(int lockMode) { public void setLockMode(int lockMode) {
switch (lockMode) { switch (lockMode) {
case Constants.LOCK_MODE_OFF: case Constants.LOCK_MODE_OFF:
if (multiThreaded) { if (multiThreaded && !isMVStore()) {
// currently the combination of LOCK_MODE=0 and MULTI_THREADED // currently the combination of MVCC=FALSE, LOCK_MODE=0 and MULTI_THREADED
// is not supported. also see code in // is not supported. also see code in
// JdbcDatabaseMetaData#supportsTransactionIsolationLevel(int) // JdbcDatabaseMetaData#supportsTransactionIsolationLevel(int)
throw DbException.get( throw DbException.get(
ErrorCode.UNSUPPORTED_SETTING_COMBINATION, ErrorCode.UNSUPPORTED_SETTING_COMBINATION,
"LOCK_MODE=0 & MULTI_THREADED"); "MVCC=FALSE & LOCK_MODE=0 & MULTI_THREADED");
} }
break; break;
case Constants.LOCK_MODE_READ_COMMITTED: case Constants.LOCK_MODE_READ_COMMITTED:
......
...@@ -74,7 +74,7 @@ public class TestScalability implements Database.DatabaseTest { ...@@ -74,7 +74,7 @@ public class TestScalability implements Database.DatabaseTest {
ArrayList<Database> dbs = new ArrayList<>(); ArrayList<Database> dbs = new ArrayList<>();
int id = 1; int id = 1;
final String h2Url = "jdbc:h2:./data/test;" + final String h2Url = "jdbc:h2:./data/test;" +
"LOCK_TIMEOUT=10000;MV_STORE=FALSE;LOCK_MODE=3"; "LOCK_TIMEOUT=10000;MV_STORE=FALSE";
dbs.add(createDbEntry(id++, "H2", 1, h2Url)); dbs.add(createDbEntry(id++, "H2", 1, h2Url));
dbs.add(createDbEntry(id++, "H2", 2, h2Url)); dbs.add(createDbEntry(id++, "H2", 2, h2Url));
dbs.add(createDbEntry(id++, "H2", 4, h2Url)); dbs.add(createDbEntry(id++, "H2", 4, h2Url));
...@@ -84,7 +84,7 @@ public class TestScalability implements Database.DatabaseTest { ...@@ -84,7 +84,7 @@ public class TestScalability implements Database.DatabaseTest {
dbs.add(createDbEntry(id++, "H2", 64, h2Url)); dbs.add(createDbEntry(id++, "H2", 64, h2Url));
final String mvUrl = "jdbc:h2:./data/mvTest;" + final String mvUrl = "jdbc:h2:./data/mvTest;" +
"LOCK_TIMEOUT=10000;MULTI_THREADED=1"; "LOCK_TIMEOUT=10000;MULTI_THREADED=1;LOCK_MODE=0";
dbs.add(createDbEntry(id++, "MV", 1, mvUrl)); dbs.add(createDbEntry(id++, "MV", 1, mvUrl));
dbs.add(createDbEntry(id++, "MV", 2, mvUrl)); dbs.add(createDbEntry(id++, "MV", 2, mvUrl));
dbs.add(createDbEntry(id++, "MV", 4, mvUrl)); dbs.add(createDbEntry(id++, "MV", 4, mvUrl));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论