db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver
Date Wed, 08 Nov 2006 22:20:59 GMT
    [ http://issues.apache.org/jira/browse/DERBY-638?page=comments#action_12448292 ] 
Bernt M. Johnsen commented on DERBY-638:

Bryan: I propose that we on the short term (and in 10.2 and possibly 10.1) fix the misleading
exception which this report is about, but keep the difference. And that the different behaviour
will be fixed e.g. for 10.3

Deepa: The current implementation will commit the active transaction. The exception is misleading,
since there is no active transaction after setTransactionIsolation in the client. Try out
d638_repro3.java. I agree that trying to make embedded and client behaviour similar is ideal,
but neither of my patches will actually fix that. 

The JDBC spec just says that "If this method is called during a transaction, the result is

> setTransactionIsolation behaviour in network client driver is different from that of
embedded driver
> ----------------------------------------------------------------------------------------------------
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions:
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java, d638_repro2.java, DERBY-638-v2.diff, DERBY-638.diff
> When autocommit is set to false, a call to setTransactionIsolation using client driver
does not end the transaction when the method exits. When a close() is called on the conection,
it throws an exception.
> Running the code below:
>        conn.setAutoCommit(false);
>        conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
>        try{
>                conn.close();
>        }catch(SQLException se){
>                System.out.println("Got exception when closing the connection");
>                se.printStackTrace();
>        }
> with client driver gives:
> Got exception when closing the connection
> org.apache.derby.client.am.SqlException: java.sql.Connection.close() requested while
a transaction is in progress on the connection.The transaction remains active, and the connection
cannot be closed.
> with embedded driver, it works okay and does not throw any exception.

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


View raw message