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 13:54:52 GMT
    [ http://issues.apache.org/jira/browse/DERBY-638?page=comments#action_12448139 ] 
Bernt M. Johnsen commented on DERBY-638:

After some investigation, I have found that this is actually three separate issues:

1) There is a difference between the embedded driver where setTransacionIsolation  does not
cause a commit and the nework client where setTransactionIsolation causes a commit (Side effect

2) setTransactionIsolation in the network client does not do the proper householding activity
wrt. this is an implicit commit and that Statement.execute("SET CURRENT ISOLATION...") is
used to implement it, and hence you get the exception documented in the description

3) (Small) The SQLState and error message is different when Connection.close() is done on
an active transaction

Suggest that 1) & 3) is placed into separate issues while this issue is related to 2)
which is the short term fix for the reported exception. 

BTW: I think the attached patch si not sufficient in the general case, where there may be
some open transaction when setTranascationIsolation is called, and that transaction is implicitely

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