提交 d561394e authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Return false for unknown levels from supportsTransactionIsolationLevel()

上级 873aa03f
...@@ -2315,7 +2315,8 @@ public class JdbcDatabaseMetaData extends TraceObject implements ...@@ -2315,7 +2315,8 @@ public class JdbcDatabaseMetaData extends TraceObject implements
@Override @Override
public boolean supportsTransactionIsolationLevel(int level) throws SQLException { public boolean supportsTransactionIsolationLevel(int level) throws SQLException {
debugCodeCall("supportsTransactionIsolationLevel"); debugCodeCall("supportsTransactionIsolationLevel");
if (level == Connection.TRANSACTION_READ_UNCOMMITTED) { switch (level) {
case Connection.TRANSACTION_READ_UNCOMMITTED: {
// Currently the combination of MV_STORE=FALSE, LOCK_MODE=0 and // Currently the combination of MV_STORE=FALSE, LOCK_MODE=0 and
// MULTI_THREADED=TRUE is not supported. Also see code in // MULTI_THREADED=TRUE is not supported. Also see code in
// Database#setLockMode(int) // Database#setLockMode(int)
...@@ -2332,7 +2333,13 @@ public class JdbcDatabaseMetaData extends TraceObject implements ...@@ -2332,7 +2333,13 @@ public class JdbcDatabaseMetaData extends TraceObject implements
return !rs.next() || !rs.getString(1).equals("1"); return !rs.next() || !rs.getString(1).equals("1");
} }
} }
return true; case Connection.TRANSACTION_READ_COMMITTED:
case Connection.TRANSACTION_REPEATABLE_READ:
case Connection.TRANSACTION_SERIALIZABLE:
return true;
default:
return false;
}
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论