tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r713787 - /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
Date Thu, 13 Nov 2008 18:59:24 GMT
Author: fhanik
Date: Thu Nov 13 10:59:24 2008
New Revision: 713787

URL: http://svn.apache.org/viewvc?rev=713787&view=rev
Log:
fix for calling close multiple times

Modified:
    tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java?rev=713787&r1=713786&r2=713787&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java Thu
Nov 13 10:59:24 2008
@@ -71,8 +71,8 @@
         if (ISCLOSED_VAL==method.getName()) {
             return isClosed();
         }
-        if (isClosed()) throw new SQLException("Connection has already been closed.");
         if (CLOSE_VAL==method.getName()) {
+            if (isClosed()) return null; //noop for already closed.
             PooledConnection poolc = this.connection;
             this.connection = null;
             pool.returnConnection(poolc);
@@ -80,6 +80,7 @@
         } else if (TOSTRING_VAL==method.getName()) {
             return this.toString();
         }
+        if (isClosed()) throw new SQLException("Connection has already been closed.");
         return method.invoke(connection.getConnection(),args);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message