You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Deepa Remesh (JIRA)" <de...@db.apache.org> on 2005/10/21 20:35:32 UTC

[jira] Created: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

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
        Type: Bug
  Components: Network Client  
    Versions: 10.2.0.0    
    Reporter: Deepa Remesh


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


[jira] Updated: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Deepa Remesh (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Deepa Remesh updated DERBY-638:
-------------------------------

    Attachment: d638_repro2.java

Thanks Bernt for looking at this issue. 

Patch1 seems better to me and will match more with the embedded implementation. With patch1, we do not commit any other statements which could be executed in the meantime. But with patch2, client driver will commit everything executed before the call to setTransactionIsolation. This, I think is not expected when we have explicitly set the connection's auto-commit to false. 

I am attaching a modified repro 'd638_repro2.java' which executes some statements after setting auto-commit to false and before the call to setTransactionIsolation. With patch1, both embedded and client driver show uncommitted transactions. With patch2, client driver commits everything.

However, it is not clear to me what the correct behaviour should be as the JDBC spec only has recommendations for the implementation of setTransactionIsolation method. But I think it will be good to keep embedded and client behaviour similar.

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

        

[jira] Commented: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Deepa Remesh (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-638?page=comments#action_12448320 ] 
            
Deepa Remesh commented on DERBY-638:
------------------------------------

I now see the current implementation will commit the transaction in all cases. The exception was indeed misleading and DERBY-638-v2.diff is more correct. I agree it will be good to fix  this misleading exception and open separate JIRAs for the other two issues. It will be good if the repro can be included as a test case in the patch. 

> 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: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java, d638_repro2.java, d638_repro3.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

        

[jira] Resolved: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen resolved DERBY-638.
------------------------------------

    Fix Version/s: 10.1.3.2
       Resolution: Fixed
       Derby Info:   (was: [Patch Available])

Backported from trunk.
Committed revision 475707

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.1.3.2, 10.2.1.8, 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3-for-10.1.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Assigned: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen reassigned DERBY-638:
--------------------------------------

    Assignee: Bernt M. Johnsen

> 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: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java
>
>
> 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

        

[jira] Updated: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Attachment: DERBY-638-v3.diff
                DERBY-638-v3.stat

Uploaded new patch (V3) whith test change that will catch changes in wether setTransactionIsolation commits or not.

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Updated: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Attachment: DERBY-638-v3-for-10.1.diff

Backport for 10.1 branch

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.2.1.8, 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3-for-10.1.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Reopened: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen reopened DERBY-638:
------------------------------------

             

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.2.1.8, 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3-for-10.1.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Updated: (DERBY-638) Newtork driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Summary: Newtork driver setTransactionIsolation() causes a commit, but does not complete it locally  (was: setTransactionIsolation behaviour in network client driver is different from that of embedded driver)

> Newtork driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java, d638_repro2.java, d638_repro3.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

        

[jira] Resolved: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen resolved DERBY-638.
------------------------------------

    Fix Version/s: 10.2.1.8
                       (was: 10.3.0.0)
       Resolution: Fixed

Committed revision 475651

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.2.1.8
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Updated: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Fix Version/s: 10.3.0.0

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.2.1.8, 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Commented: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-638?page=comments#action_12448196 ] 
            
Bryan Pendleton commented on DERBY-638:
---------------------------------------

Hi Bernt, I haven't read your code, just trying to follow the comments, but: are you proposing
to change the client to match the embedded behavior, or are you proposing to change
embedded to match the client behavior (or maybe you're proposing some 3rd thing entirely)?

> 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: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.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

        

[jira] Updated: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Deepa Remesh updated DERBY-638:
-------------------------------

    Attachment: d638.java

Attaching a repro for this. To run with embedded driver, use "java d638". To run with client driver, start network server on port 1528 and use "java d638 client". Client driver throws an exception. It should not throw this exception and should match the behaviour of embedded driver.

> 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
>         Type: Bug
>   Components: Network Client
>     Versions: 10.2.0.0
>     Reporter: Deepa Remesh
>  Attachments: d638.java
>
> 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


[jira] Commented: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
    [ 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 implementation-defined."

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

        

[jira] Updated: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Summary: Network driver setTransactionIsolation() causes a commit, but does not complete it locally  (was: Newtork driver setTransactionIsolation() causes a commit, but does not complete it locally)

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java, d638_repro2.java, d638_repro3.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

        

[jira] Updated: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Attachment: d638_repro3.java

> 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: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.java, d638_repro2.java, d638_repro3.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

        

[jira] Commented: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-638?page=comments#action_12332727 ] 

Satheesh Bandaram commented on DERBY-638:
-----------------------------------------

I think this bug needs to be cross linked to DERBY-310, that tracks all known differences between Derby client and embedded drivers.

http://issues.apache.org/jira/browse/DERBY-310

> 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
>         Type: Bug
>   Components: Network Client
>     Versions: 10.2.0.0
>     Reporter: Deepa Remesh
>  Attachments: d638.java
>
> 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


[jira] Commented: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
    [ 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 of using SET CURRENT ISOLATION).

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


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

        

[jira] Resolved: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen resolved DERBY-638.
------------------------------------

    Fix Version/s: 10.3.0.0
       Resolution: Fixed

Committed revision 474720.


> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Updated: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Attachment: DERBY-638.diff

Simple patch for this case. Ideally setTransactionIsolation should have been done with some DRDA mechanism piggybacking the next query/update and (e.g. like setQueryTimeout were done), but this would do as long as we're using statement.execute("SET CURRENT ISOLATION...");

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

        

[jira] Updated: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Attachment: DERBY-638-v2.diff

Simpler, cleaner, more correct.

> 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: 10.2.1.6
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>         Attachments: d638.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

        

[jira] Reopened: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen reopened DERBY-638:
------------------------------------

             

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Updated: (DERBY-638) Network driver setTransactionIsolation() causes a commit, but does not complete it locally

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Affects Version/s: 10.1.3.1
                       10.3.0.0

> Network driver setTransactionIsolation() causes a commit, but does not complete it locally
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-638
>                 URL: http://issues.apache.org/jira/browse/DERBY-638
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.2.1.6, 10.1.3.1, 10.3.0.0
>            Reporter: Deepa Remesh
>         Assigned To: Bernt M. Johnsen
>             Fix For: 10.3.0.0
>
>         Attachments: d638.java, d638_repro2.java, d638_repro3.java, DERBY-638-v2.diff, DERBY-638-v3.diff, DERBY-638-v3.stat, 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

        

[jira] Updated: (DERBY-638) setTransactionIsolation behaviour in network client driver is different from that of embedded driver

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-638?page=all ]

Bernt M. Johnsen updated DERBY-638:
-----------------------------------

    Derby Info: [Patch Available]

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