db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <derby-...@db.apache.org>
Subject [jira] Created: (DERBY-1144) With client PooledConnection.getConnection() does not reset holdability and isolation state properly
Date Thu, 23 Mar 2006 19:24:18 GMT
With client PooledConnection.getConnection() does not reset holdability and isolation state
properly
----------------------------------------------------------------------------------------------------

         Key: DERBY-1144
         URL: http://issues.apache.org/jira/browse/DERBY-1144
     Project: Derby
        Type: Bug
  Components: Network Client  
    Versions: 10.1.2.2, 10.1.2.3    
    Reporter: Kathey Marsden
 Assigned to: Kathey Marsden 
     Fix For: 10.2.0.0, 10.1.2.4


I found this issue when working on DERBY-1044 which was filed for the isolation not getting
reset for XAConnections.
I found that this was a generic issue for PooledConnections and also that holdability was
also wrong.

The fix proposed for DERBY-1044 should also fix this issue.  That bug has the repro for the
isolation state issue

For holdability, this code passes for embedded but fails for client:

    
        // Test holdability   
        ConnectionPoolDataSource ds = TestUtil.getConnectionPoolDataSource(p);
        pc1 = ds.getPooledConnection();
        testPooledConnHoldability("PooledConnection", pc1);
        pc1.close();

      **
	 * @param string
	 * @param pc1
	 */
	private static void testPooledConnHoldability(String string, PooledConnection pc1) 
	throws SQLException { 
		System.out.println("\n**Test holdability state**");
		Connection conn  = pc1.getConnection();
		conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
		// reset the connection and see if the holdability gets reset 
		conn = pc1.getConnection();
		int holdability = conn.getHoldability();
		if (holdability != ResultSet.HOLD_CURSORS_OVER_COMMIT)
		{
			System.out.println("FAIL: Holdability not reset on get Connection");			
		}
		else 
		{
			System.out.println("PASS: Holdability reset on getConnection");
		}
		conn.close();
	}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message