commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r591819 - /commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java
Date Sun, 04 Nov 2007 19:29:26 GMT
Author: psteitz
Date: Sun Nov  4 11:29:25 2007
New Revision: 591819

URL: http://svn.apache.org/viewvc?rev=591819&view=rev
Log:
Fixed cleanUp to eliminate 'already closed' exception when getConnection fails in execute.

Modified:
    commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java

Modified: commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java
URL: http://svn.apache.org/viewvc/commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java?rev=591819&r1=591818&r2=591819&view=diff
==============================================================================
--- commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java
(original)
+++ commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java
Sun Nov  4 11:29:25 2007
@@ -107,7 +107,13 @@
     
     /** Close connection */
     public void cleanUp() throws Exception {
-        conn.close();
+        if (conn != null) {
+            try {
+                conn.close();
+            } finally {
+                conn = null;
+            } 
+        }
     }
 
 }



Mime
View raw message