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] Commented: (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
Date Tue, 21 Mar 2006 20:59:25 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1044?page=comments#action_12371293 ] 

Kathey Marsden commented on DERBY-1044:
---------------------------------------

I verified that this is a generic problem for connections obtained from PooledConnections
so is not limitted to XA.  Should I open another issue for that or is it ok to just fix it
under this one?

This small change fixes the symptom but I am a bit perplexed about why it was  explicitly
set to false to *not*  recompute the state from the datasource before and the difference in
the new connection case where it calls lightreset.

Regardless, hopefully I will have a patch for this issue soon.  Please send on any comments
or insight.  Thanks.


Index: java/client/org/apache/derby/client/ClientPooledConnection.java
===================================================================
--- java/client/org/apache/derby/client/ClientPooledConnection.java     (revision 387603)
+++ java/client/org/apache/derby/client/ClientPooledConnection.java     (working copy)
@@ -173,7 +173,7 @@
             createLogicalConnection();

             if (!newPC_) {
-                physicalConnection_.reset(logWriter_, user_, password_, ds_, false); // false
means do not recompute
+                physicalConnection_.reset(logWriter_, user_, password_, ds_, true); // true
means do recompute
             }
             // properties from the dataSource
             // properties don't change


> [xa] client XAConnection.getConnection()  does not have the correct  default isolation
level if set by an earlier connection obtained from the same XAConnection
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1044
>          URL: http://issues.apache.org/jira/browse/DERBY-1044
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Versions: 10.1.2.3, 10.1.3.0, 10.2.0.0, 10.1.2.2
>     Reporter: Kathey Marsden
>     Assignee: Kathey Marsden
>     Priority: Critical
>      Fix For: 10.1.3.0, 10.2.0.0, 10.1.2.4
>  Attachments: IsoChange.java
>
> If the isolation level is set on a connection obtained with XAConnection.getConnection()
 and then another connection is obtained from the same XAConnection, then the isolation will
not be the default READ_COMMITTED but will be the isolation level set on the previous connection.
 
> See this code in checkDataSource.java
> I will add a reference to this bug
>                cs1 = xac.getConnection();
> 		printState("new handle - local ", cs1);
> 		cs1.close();
> 		xar.start(xid, XAResource.TMJOIN);
> 		cs1 = xac.getConnection();
>                 cs1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
> 		printState("pre-X1 commit - local", cs1);
> 		xar.start(xid, XAResource.TMJOIN);
> 		printState("pre-X1 commit - X1", cs1);
> 		xar.end(xid, XAResource.TMSUCCESS);
> 		printState("post-X1 end - local", cs1);
> 		xar.commit(xid, true);
> 		printState("post-X1 commit - local", cs1);
> 		cs1.close();
> 		System.out.println("Some more isolation testing using SQL and JDBC api");
>                 //  The  initial isolation level for this connection is REPEATABLE_READ.
 Left over from the last connection.
>                // It should be READ_COMMITTED
> 		cs1 = xac.getConnection();
> 		s = cs1.createStatement();
> 		printState("initial local", cs1);

-- 
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