commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1547582 - in /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2: DelegatingConnection.java PoolableConnection.java
Date Tue, 03 Dec 2013 20:40:40 GMT
Author: markt
Date: Tue Dec  3 20:40:40 2013
New Revision: 1547582

URL: http://svn.apache.org/r1547582
Log:
Follow-up to close() refactoring in r1547553
Fix some edge cases identified in some soon to be committed refactoring.

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnection.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java?rev=1547582&r1=1547581&r2=1547582&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
Tue Dec  3 20:40:40 2013
@@ -242,6 +242,12 @@ public class DelegatingConnection extend
      */
     @Override
     public void close() throws SQLException {
+        if (!_closed) {
+            closeInternal();
+        }
+    }
+
+    protected final void closeInternal() throws SQLException {
         try {
             passivate();
         } finally {
@@ -252,7 +258,7 @@ public class DelegatingConnection extend
             }
         }
     }
-
+    
     protected void handleException(SQLException e) throws SQLException {
         throw e;
     }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnection.java?rev=1547582&r1=1547581&r2=1547582&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnection.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnection.java Tue
Dec  3 20:40:40 2013
@@ -111,7 +111,7 @@ public class PoolableConnection extends 
      * Actually close my underlying {@link Connection}.
      */
     public void reallyClose() throws SQLException {
-        super.close();
+        super.closeInternal();
     }
 }
 



Mime
View raw message