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