commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r834702 - in /commons/proper/dbcp/trunk: src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java xdocs/changes.xml
Date Tue, 10 Nov 2009 23:01:56 GMT
Author: markt
Date: Tue Nov 10 23:01:56 2009
New Revision: 834702

URL: http://svn.apache.org/viewvc?rev=834702&view=rev
Log:
Fix DBCP-303. Patch provided by Dave Oxley.

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
    commons/proper/dbcp/trunk/xdocs/changes.xml

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java?rev=834702&r1=834701&r2=834702&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
Tue Nov 10 23:01:56 2009
@@ -410,9 +410,16 @@
             PStmtKey key = (PStmtKey)obj;
             if (null == key._resultSetType 
                     && null == key._resultSetConcurrency) {
-                return new PoolablePreparedStatementStub(
-                        connection.prepareStatement(key._sql),
-                        key, pstmtPool, delegatingConnection);
+                if (null == key._autoGeneratedKeys) {
+                    return new PoolablePreparedStatementStub(
+                            connection.prepareStatement(key._sql),
+                            key, pstmtPool, delegatingConnection);
+                } else {
+                    return new PoolablePreparedStatementStub(
+                            connection.prepareStatement(key._sql,
+                                    key._autoGeneratedKeys.intValue()),
+                            key, pstmtPool, delegatingConnection);
+                }
             } else {
                 return new PoolablePreparedStatementStub(
                         connection.prepareStatement(key._sql,

Modified: commons/proper/dbcp/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/xdocs/changes.xml?rev=834702&r1=834701&r2=834702&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/xdocs/changes.xml (original)
+++ commons/proper/dbcp/trunk/xdocs/changes.xml Tue Nov 10 23:01:56 2009
@@ -42,6 +42,10 @@
      new features as well as bug fixes and instrumentation.  Some bug fixes
      will change semantics (e.g. connection close will become idempotent).
      The minimum JDK level will be increased to 1.4">
+      <action dev="markt" type="fix" issue="DBCP-303" due-to="Dave Oxley">
+        Ensure Statement.getGeneratedKeys() works correctly with the CPDS
+        adapter.
+      </action>
       <action dev="psteitz" type="fix" issue="DBCP-302" due-to="Sebastian Bazley">
         Removed incorrectly advertised ClassNotFoundException from
         JOCLContentHandler.ConstructorDetails.createObject().



Mime
View raw message