commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1549677 - in /commons/proper/dbcp/trunk/src: changes/changes.xml java/org/apache/commons/dbcp2/DelegatingConnection.java
Date Mon, 09 Dec 2013 20:54:45 GMT
Author: markt
Date: Mon Dec  9 20:54:45 2013
New Revision: 1549677

URL: http://svn.apache.org/r1549677
Log:
DBCP-380
Correct implementation of DelegatingConnection.isWrapperFor() so it works correctly with older
JDBC drivers.
Patch provided by Balazs Zsoldos.

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

Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1549677&r1=1549676&r2=1549677&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Mon Dec  9 20:54:45 2013
@@ -96,6 +96,10 @@ The <action> type attribute can be add,u
       <action dev="markt" issue="DBCP-396" type="fix">
         Expose all of the AbandonedConfig properties through a BasicDataSource.
       </action>
+      <action dev="markt" issue="DBCP-380" type="fix" due-to="Balazs Zsoldos">
+        Correct implementation of DelegatingConnection.isWrapperFor() so it
+        works correctly with older JDBC drivers.
+      </action>
     </release>
     <release version="1.4.1" date="TBD" description="TBD">
       <action dev="psteitz" issue="DBCP-334" type="update" due-to="Alberto Mozzone">

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=1549677&r1=1549676&r2=1549677&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
Mon Dec  9 20:54:45 2013
@@ -780,7 +780,13 @@ public class DelegatingConnection<C exte
 
     @Override
     public boolean isWrapperFor(Class<?> iface) throws SQLException {
-        return iface.isAssignableFrom(getClass()) || _conn.isWrapperFor(iface);
+        if (iface.isAssignableFrom(getClass())) {
+            return true;
+        } else if (iface.isAssignableFrom(_conn.getClass())) {
+            return true;
+        } else {
+            return _conn.isWrapperFor(iface);
+        }
     }
 
     @Override



Mime
View raw message