db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r642942 - in /db/derby/code/trunk/java: client/org/apache/derby/client/ClientPooledConnection.java testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
Date Mon, 31 Mar 2008 09:48:06 GMT
Author: kristwaa
Date: Mon Mar 31 02:48:04 2008
New Revision: 642942

URL: http://svn.apache.org/viewvc?rev=642942&view=rev
Log:
DERBY-3379: "No Current connection" on PooledConnection.getConnection() if pooled connection
is reused during connectionClosed processing.
Patch file: derby-3379-3a-minimal_fix_and_test_enabling.diff

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java?rev=642942&r1=642941&r2=642942&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java Mon
Mar 31 02:48:04 2008
@@ -335,6 +335,10 @@
             physicalConnection_.agent_.logWriter_.traceEntry(this, "recycleConnection");
         }
 
+        // Null out the reference to the logical connection that is currently
+        // being closed.
+        this.logicalConnection_ = null;
+
         for (Iterator e = listeners_.iterator(); e.hasNext();) {
             ConnectionEventListener listener =
                     (ConnectionEventListener)e.next();
@@ -368,8 +372,8 @@
     }
 
     /**
-     * Used by <code>LogicalConnection.close</code> when it disassociates itself
-     * from the pooled connection.
+     * Used by {@code LogicalConnection.close} in some circumstances when
+     * it disassociates itself from the pooled connection.
      */
     public synchronized void nullLogicalConnection() {
         logicalConnection_ = null;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java?rev=642942&r1=642941&r2=642942&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
Mon Mar 31 02:48:04 2008
@@ -143,6 +143,7 @@
         suite.addTest(new J2EEDataSourceTest("testClosedCPDSConnection"));
         suite.addTest(new J2EEDataSourceTest("testClosedXADSConnection"));
         suite.addTest(new J2EEDataSourceTest("testSetSchemaInXAConnection"));
+        suite.addTest(new J2EEDataSourceTest("testPooledReuseOnClose"));
         return suite;
     }
 
@@ -170,11 +171,6 @@
     private static Test getEmbeddedSuite(String postfix) {
         TestSuite suite = new TestSuite("Embedded" + postfix);
         suite.addTest(new J2EEDataSourceTest("testDSRequestAuthentication"));
-        // Due to a bug following cannot be run for client - DERBY-3379
-        // To run this fixture with client, add to getClientSuite(),
-        // when DERBY-3379 is fixed, remove from here (and client) and
-        // move to baseSuite.
-        suite.addTest(new J2EEDataSourceTest("testPooledReuseOnClose"));
         // when DERBY-2498 gets fixed, move this one to baseSuite
         suite.addTest(new J2EEDataSourceTest("testJira95pds"));
         // Following cannot run with client because of DERBY-2533; it hangs



Mime
View raw message