You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2006/04/08 03:17:01 UTC

svn commit: r392471 - /db/derby/code/branches/10.1/java/client/org/apache/derby/client/ClientPooledConnection.java

Author: kmarsden
Date: Fri Apr  7 18:16:59 2006
New Revision: 392471

URL: http://svn.apache.org/viewcvs?rev=392471&view=rev
Log:
DERBY-1144 With client PooledConnection.getConnection() does not reset holdability and isolation state properly
DERBY-1044  [xa] client XAConnection.getConnection() does not have the correct default isolation level if set by an earlier connection obtained from the same XAConnection


merge from trunk.  This part is just the code change.
Test change will follow once checkDataSource hang is resolved on trunk.
Verified fix manually.


Modified:
    db/derby/code/branches/10.1/java/client/org/apache/derby/client/ClientPooledConnection.java

Modified: db/derby/code/branches/10.1/java/client/org/apache/derby/client/ClientPooledConnection.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/client/org/apache/derby/client/ClientPooledConnection.java?rev=392471&r1=392470&r2=392471&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/client/org/apache/derby/client/ClientPooledConnection.java (original)
+++ db/derby/code/branches/10.1/java/client/org/apache/derby/client/ClientPooledConnection.java Fri Apr  7 18:16:59 2006
@@ -138,20 +138,22 @@
         }
         createLogicalConnection();
 
-        if (!newPC_) {
-            physicalConnection_.reset(logWriter_, user_, password_, ds_, false); // false means do not recompute
-        }
-        // properties from the dataSource
-        // properties don't change
-        else {
-            physicalConnection_.lightReset();    //poolfix
-        }
-        newPC_ = false;
+            if (!newPC_) {
+            	// DERBY-1144 changed the last parameter of this method to true
+            	// to reset the connection state to the default on 
+            	// PooledConnection.getConnection() otherwise the 
+            	// isolation level and holdability was not correct and out of sync with the server.
+                physicalConnection_.reset(logWriter_, user_, password_, ds_, true);
+            }
+            else {
+                physicalConnection_.lightReset();    //poolfix
+            }
+            newPC_ = false;
 
-        if (logWriter_ != null) {
-            logWriter_.traceExit(this, "getConnection", logicalConnection_);
-        }
-        return logicalConnection_;
+            if (logWriter_ != null) {
+                logWriter_.traceExit(this, "getConnection", logicalConnection_);
+            }
+            return logicalConnection_;
     }
 
     private void createLogicalConnection() throws SqlException {