ozeigermann 2004/11/10 14:06:11
Modified: src/stores/org/apache/slide/store/impl/rdbms
StandardRDBMSAdapter.java
Log:
Reversed the sequence of closing statement and connection to avoid error
with temporary connections
Revision Changes Path
1.38 +12 -10
jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/StandardRDBMSAdapter.java
Index: StandardRDBMSAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/StandardRDBMSAdapter.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- StandardRDBMSAdapter.java 5 Oct 2004 20:53:31 -0000 1.37
+++ StandardRDBMSAdapter.java 10 Nov 2004 22:06:11 -0000 1.38
@@ -737,10 +737,12 @@
}
}
} finally {
- // do not close when not compressed, as stream needs to be
read
- // before
- if (bcompress) {
- try {
+ try {
+ close(statement, res);
+ } finally {
+ // do not close when not compressed, as stream needs to
be read
+ // before
+ if (bcompress) {
if (temporaryConnection) {
// XXX is needed, as calling store does not know
if
// connection should be closed now
@@ -750,8 +752,6 @@
connection.close();
}
}
- } finally {
- close(statement, res);
}
}
}
@@ -1407,6 +1407,7 @@
try {
if (statement != null) {
statement.close();
+ statement = null;
}
} catch (SQLException e) {
getLogger().log(e, LOG_CHANNEL, Logger.WARNING);
@@ -1424,6 +1425,7 @@
try {
if (statement != null) {
statement.close();
+ statement = null;
}
} catch (SQLException e) {
getLogger().log(e, LOG_CHANNEL, Logger.WARNING);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]