提交 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:
<ul>
<li><b>Serializable</b><br />
This is the default level.<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
This is the default level.<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
</li><li><b>Read Committed</b><br />
Read locks are released immediately.
Higer concurrency is possible when using this level.<br />
This is the isolation level used for many database systems.<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
Read locks are released immediately.
Higer concurrency is possible when using this level.<br />
This is the isolation level used for many database systems.<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
</li><li><b>Read Uncommitted</b><br />
This level means that transaction isolation is disabled.<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
This level means that transaction isolation is disabled.<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
</li>
</ul>
......
......@@ -764,26 +764,26 @@ public class Database implements DataHandler {
}
void close(boolean fromShutdownHook) {
synchronized(this) {
this.closing = true;
if(sessions.size() > 0) {
if(!fromShutdownHook) {
return;
}
traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName + " from shutdown hook");
Session[] all = new Session[sessions.size()];
sessions.toArray(all);
for(int i=0; i<all.length; i++) {
Session s = all[i];
try {
s.close();
} catch(SQLException e) {
traceSystem.getTrace(Trace.SESSION).error("disconnecting #" + s.getId(), e);
}
}
}
}
traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName);
synchronized(this) {
this.closing = true;
if(sessions.size() > 0) {
if(!fromShutdownHook) {
return;
}
traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName + " from shutdown hook");
Session[] all = new Session[sessions.size()];
sessions.toArray(all);
for(int i=0; i<all.length; i++) {
Session s = all[i];
try {
s.close();
} catch(SQLException e) {
traceSystem.getTrace(Trace.SESSION).error("disconnecting #" + s.getId(), e);
}
}
}
}
traceSystem.getTrace(Trace.DATABASE).info("closing " + databaseName);
if(eventListener != null) {
eventListener.closingDatabase();
eventListener = null;
......
......@@ -275,7 +275,7 @@ public class Session implements SessionInterface {
undoLog.add(log);
}
public void unlockReadLocks() {
public void unlockReadLocks() {
for(int i=0; i<locks.size(); i++) {
Table t = (Table)locks.get(i);
if(!t.isLockedExclusively()) {
......@@ -284,7 +284,7 @@ public class Session implements SessionInterface {
i--;
}
}
}
}
private void unlockAll() throws SQLException {
if(Constants.CHECK) {
......
......@@ -300,7 +300,7 @@ public class TableData extends Table implements RecordReader {
if (lockExclusive == null) {
if(lockMode == Constants.LOCK_MODE_READ_COMMITTED && !Constants.MULTI_THREADED_KERNEL) {
// 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;
} else if(!lockShared.contains(session)) {
traceLock(session, exclusive, "ok");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论