提交 bc484005 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 a2a2f8ca
...@@ -98,19 +98,19 @@ This database supports the following transaction isolation levels: ...@@ -98,19 +98,19 @@ This database supports the following transaction isolation levels:
<ul> <ul>
<li><b>Serializable</b><br /> <li><b>Serializable</b><br />
This is the default level.<br /> This is the default level.<br />
To enable, execute the SQL statement 'SET LOCK_MODE 0'<br /> To enable, execute the SQL statement 'SET LOCK_MODE 0'<br />
or append ;LOCK_MODE=1 to the database URL: jdbc:h2:~/test;LOCK_MODE=1 or append ;LOCK_MODE=1 to the database URL: jdbc:h2:~/test;LOCK_MODE=1
</li><li><b>Read Committed</b><br /> </li><li><b>Read Committed</b><br />
Read locks are released immediately. Read locks are released immediately.
Higer concurrency is possible when using this level.<br /> Higer concurrency is possible when using this level.<br />
This is the isolation level used for many database systems.<br /> This is the isolation level used for many database systems.<br />
To enable, execute the SQL statement 'SET LOCK_MODE 0'<br /> To enable, execute the SQL statement 'SET LOCK_MODE 0'<br />
or append ;LOCK_MODE=3 to the database URL: jdbc:h2:~/test;LOCK_MODE=3 or append ;LOCK_MODE=3 to the database URL: jdbc:h2:~/test;LOCK_MODE=3
</li><li><b>Read Uncommitted</b><br /> </li><li><b>Read Uncommitted</b><br />
This level means that transaction isolation is disabled.<br /> This level means that transaction isolation is disabled.<br />
To enable, execute the SQL statement 'SET LOCK_MODE 0'<br /> To enable, execute the SQL statement 'SET LOCK_MODE 0'<br />
or append ;LOCK_MODE=0 to the database URL: jdbc:h2:~/test;LOCK_MODE=0 or append ;LOCK_MODE=0 to the database URL: jdbc:h2:~/test;LOCK_MODE=0
</li> </li>
</ul> </ul>
......
...@@ -764,26 +764,26 @@ public class Database implements DataHandler { ...@@ -764,26 +764,26 @@ public class Database implements DataHandler {
} }
void close(boolean fromShutdownHook) { void close(boolean fromShutdownHook) {
synchronized(this) { synchronized(this) {
this.closing = true; this.closing = true;
if(sessions.size() > 0) { if(sessions.size() > 0) {
if(!fromShutdownHook) { if(!fromShutdownHook) {
return; return;
} }
traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName + " from shutdown hook"); traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName + " from shutdown hook");
Session[] all = new Session[sessions.size()]; Session[] all = new Session[sessions.size()];
sessions.toArray(all); sessions.toArray(all);
for(int i=0; i<all.length; i++) { for(int i=0; i<all.length; i++) {
Session s = all[i]; Session s = all[i];
try { try {
s.close(); s.close();
} catch(SQLException e) { } catch(SQLException e) {
traceSystem.getTrace(Trace.SESSION).error("disconnecting #" + s.getId(), e); traceSystem.getTrace(Trace.SESSION).error("disconnecting #" + s.getId(), e);
} }
} }
} }
} }
traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName); traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName);
if(eventListener != null) { if(eventListener != null) {
eventListener.closingDatabase(); eventListener.closingDatabase();
eventListener = null; eventListener = null;
......
...@@ -275,7 +275,7 @@ public class Session implements SessionInterface { ...@@ -275,7 +275,7 @@ public class Session implements SessionInterface {
undoLog.add(log); undoLog.add(log);
} }
public void unlockReadLocks() { public void unlockReadLocks() {
for(int i=0; i<locks.size(); i++) { for(int i=0; i<locks.size(); i++) {
Table t = (Table)locks.get(i); Table t = (Table)locks.get(i);
if(!t.isLockedExclusively()) { if(!t.isLockedExclusively()) {
...@@ -284,7 +284,7 @@ public class Session implements SessionInterface { ...@@ -284,7 +284,7 @@ public class Session implements SessionInterface {
i--; i--;
} }
} }
} }
private void unlockAll() throws SQLException { private void unlockAll() throws SQLException {
if(Constants.CHECK) { if(Constants.CHECK) {
......
...@@ -300,7 +300,7 @@ public class TableData extends Table implements RecordReader { ...@@ -300,7 +300,7 @@ public class TableData extends Table implements RecordReader {
if (lockExclusive == null) { if (lockExclusive == null) {
if(lockMode == Constants.LOCK_MODE_READ_COMMITTED && !Constants.MULTI_THREADED_KERNEL) { if(lockMode == Constants.LOCK_MODE_READ_COMMITTED && !Constants.MULTI_THREADED_KERNEL) {
// READ_COMMITTED read locks are acquired but they are released immediately // READ_COMMITTED read locks are acquired but they are released immediately
// when allowing only one thread, no read locks are required // when allowing only one thread, no read locks are required
return; return;
} else if(!lockShared.contains(session)) { } else if(!lockShared.contains(session)) {
traceLock(session, exclusive, "ok"); traceLock(session, exclusive, "ok");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论