commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1568641 - /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
Date Sat, 15 Feb 2014 16:31:34 GMT
Author: markt
Date: Sat Feb 15 16:31:34 2014
New Revision: 1568641

URL: http://svn.apache.org/r1568641
Log:
Restore code that sets delegate to null otherwise PoolGuardConnectionWrapper can't do what
it is meant to.

Modified:
    commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java

Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java?rev=1568641&r1=1568640&r2=1568641&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
Sat Feb 15 16:31:34 2014
@@ -203,5 +203,21 @@ public class PoolingDataSource<C extends
                 return null;
             }
         }
+
+        @Override
+        public void close() throws SQLException {
+            if (getDelegateInternal() != null) {
+                super.close();
+                super.setDelegate(null);
+            }
+        }
+
+        @Override
+        public boolean isClosed() throws SQLException {
+            if (getDelegateInternal() == null) {
+                return true;
+            }
+            return super.isClosed();
+        }
     }
 }



Mime
View raw message