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

More bugs in the server-less multi-connection mode - reconnected only one statement.

上级 fbbecfe6
......@@ -18,7 +18,7 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>-
<ul><li>More bugs in the server-less multi-connection mode have been fixed.
</li></ul>
<h2>Version 1.1.114 (2009-06-01)</h2>
......
......@@ -1273,22 +1273,20 @@ public class JdbcConnection extends TraceObject implements Connection {
* Check if this connection is closed.
* The next operation is a read request.
*
* @return true if the session was re-connected
* @throws SQLException if the connection or session is closed
*/
protected boolean checkClosed() throws SQLException {
return checkClosed(false);
protected void checkClosed() throws SQLException {
checkClosed(false);
}
/**
* Check if this connection is closed.
* The next operation may be a write request.
*
* @return true if the session was re-connected
* @throws SQLException if the connection or session is closed
*/
private boolean checkClosedForWrite() throws SQLException {
return checkClosed(true);
private void checkClosedForWrite() throws SQLException {
checkClosed();
}
/**
......@@ -1296,10 +1294,9 @@ public class JdbcConnection extends TraceObject implements Connection {
* Check if this connection is closed.
*
* @param write if the next operation is possibly writing
* @return true if the session was re-connected
* @throws SQLException if the connection or session is closed
*/
protected boolean checkClosed(boolean write) throws SQLException {
protected void checkClosed(boolean write) throws SQLException {
if (session == null) {
throw Message.getSQLException(ErrorCode.OBJECT_CLOSED);
}
......@@ -1310,9 +1307,7 @@ public class JdbcConnection extends TraceObject implements Connection {
trace.debug("reconnect");
session = session.reconnect();
setTrace(session.getTrace());
return true;
}
return false;
}
String getURL() throws SQLException {
......
......@@ -868,15 +868,15 @@ public class JdbcStatement extends TraceObject implements Statement {
if (conn == null) {
throw Message.getSQLException(ErrorCode.OBJECT_CLOSED);
}
if (!conn.checkClosed(write)) {
return false;
}
do {
session = conn.getSession();
conn.checkClosed(write);
SessionInterface s = conn.getSession();
if (s != session) {
session = s;
setTrace(session.getTrace());
} while (conn.checkClosed(write));
return true;
}
return false;
}
/**
* Close and old result set if there is still one open.
......
......@@ -494,11 +494,11 @@ implements XAConnection, XAResource
return isClosed || super.isClosed();
}
protected synchronized boolean checkClosed(boolean write) throws SQLException {
protected synchronized void checkClosed(boolean write) throws SQLException {
if (isClosed) {
throw Message.getSQLException(ErrorCode.OBJECT_CLOSED);
}
return super.checkClosed(write);
super.checkClosed(write);
}
}
......
......@@ -293,8 +293,9 @@ java org.h2.test.TestAll timer
/*
shell tool: document encoding problem. mac: use
java -Dfile.encoding=UTF-8;
shell tool: document encoding problem.
mac: java -Dfile.encoding=UTF-8
windows:
test case for running out of disk space (using a special file system)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论