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 "Oyvind Bakksjo (JIRA)" <de...@db.apache.org> on 2005/11/09 13:32:19 UTC

[jira] Created: (DERBY-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Statement exceptions cause all the connection's result sets to be closed with the client driver
-----------------------------------------------------------------------------------------------

         Key: DERBY-694
         URL: http://issues.apache.org/jira/browse/DERBY-694
     Project: Derby
        Type: Bug
  Components: Network Client  
    Versions: 10.1.1.1    
    Reporter: Oyvind Bakksjo
    Priority: Minor


Scenario:

Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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


    Attachment: DERBY-694_v3.diff
                DERBY-694_v3.stat

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

V.Narayanan updated DERBY-694:
------------------------------

    Attachment: DERBY-694_v2.diff
                DERBY-694_v2.stat

In generating a solution for the above issue keeping in mind the comments received my basic aim for the solution was to move the check for the exception severity to a place where it will be a generic check for all the places from which a ABNUOWRM might be generated.

a) I moved this try catch to the 
   parseAbnormalEndUow(ConnectionCallbackInterface   
   connection) method. 

b) In doing so I needed to get the severity of the exception that has been raised. 

c) This I get from sqlca.getSqlCode(). An sqlca will be
   obtained from the SQLCARD which is obtained from parsing
   the ABNUOWRM. The SQLCARD is a byte string specifying
   information about conditions detected during relational
   database processing.

   c.1)  I inferred that the getSqlCode() contains the     
           severity information from the code for   
           SqlExceptionFactory40 where in the getSQLException
           method we check for errCode >=
           ExceptionSeverity.SESSION_SEVERITY. 

   c.2) This method is called from
           SqlException.getSQLException() which in turn passes
           to this as parameter return value of getErrorCode().

    c.3) getErrorCode() inturn obtains the error code from
            sqlca_.getSqlCode() when sqlca_ is not null.

I have attached a patch having generated the solution on the above lines. I have tested the patch with the test program that was attached when the issue was reported. If this design is fine I will modify this test program into a junit test in a follow up patch. 

I did'nt attach the test as part of the patch since I have redesigned the solution and I wanted to request for a opinion on the design and I could attach the unit tests in a subsequent patch.

thanx
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12426256 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

Doing a getSqlCode() on NetSqlCa in the above case was returning a -1. This value is less than ExceptionSeverity.STATEMENT_SEVERITY(20000) hence it was passing in my previous patch. 

I did not however have a way of ever deciding on this as the right method to check for exception severity. (I would have needed to generate a ABNUOWRM with severity > STATEMENT_SEVERITY)

My only lifeline in this case was through the following 

<cutting and pasting from the comments above>

c.1) I inferred that the getSqlCode() contains the
           severity information from the code for
           SqlExceptionFactory40 where in the getSQLException
           method we check for errCode >=
           ExceptionSeverity.SESSION_SEVERITY.

   c.2) This method is called from
           SqlException.getSQLException() which in turn passes
           to this as parameter return value of getErrorCode().

    c.3) getErrorCode() inturn obtains the error code from
            sqlca_.getSqlCode() when sqlca_ is not null. 

To test the above inference I needed a way of generating an ABNUOWRM with severity greater than STATEMENT_SEVERITY becase in this case getSqlCode() cannot be -1. But I wasn't able to generate this case. I have already mentioned this in the above comments.

NetSqlCa.getSqlState() on the other hand does not return me a default value like -1 but returns 22012 from which the severity is derived. So I can be sure that getSqlState does return me a valid value from which I can call the ExceptionUtil methods to derive severity . 

I did'nt feel safe sticking to the getSqlCode way which is based on an inference and a test that passes because a default value of getSqlCode is lesser than severity value. Hence I decided to stick to the getSqlState method. 

If there is someone who can guide me into generating a test case that can generate a ABNUOWRM with severity > STATEMENT_SEVERITY I most humbly request for guidance from them.

thanx
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12428574 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

Have addressed DERBY-705 and have attached a patch for the same.
thanx
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12426238 ] 
            
Daniel John Debrunner commented on DERBY-694:
---------------------------------------------

Why is getting the severity from the SQLSate better than from the SQL code?

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

Knut Anders Hatlen resolved DERBY-694.
--------------------------------------

    Fix Version/s: 10.2.1.0
       Resolution: Fixed

Marking the issue as fixed since Narayanan's patch has been committed.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>             Fix For: 10.2.1.0
>
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

V.Narayanan updated DERBY-694:
------------------------------

    Attachment: DERBY-694_v6.diff
                DERBY-694_v6.stat

Excluding the test from running in the DerbyNet framework. Ran derbyall now. It ran fine. I am extremely sorry for the failures in DerbyNet framework in the earlier patch. Thanx a ton for taking the pains to run derbyall on the earlier patch.

thanx once again
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12426584 ] 
            
Rick Hillegas commented on DERBY-694:
-------------------------------------

Thanks, Narayanan, for all this good work. I am running derbyall now. Unless someone objects, if the tests succeed I intend to commit this patch tomorrow.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rajesh Kartha (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12427987 ] 
            
Rajesh Kartha commented on DERBY-694:
-------------------------------------

Was wondering if this issue was close to resolution and will DERBY-705 ( Testing of concurrent executions on same connection was disabled) be also addressed along with it..

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12424615 ] 
            
Rick Hillegas commented on DERBY-694:
-------------------------------------

You may be able to generate a transaction severity error by invoking a user-written procedure which in turn raises some transaction severity Derby exception.

I don't know how to fake an ABNUOWRM in a client-side LOB. It may not be possible today if none of the methods are actually forwarded to the server. Perhaps this is a red herring.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

I went through this patch and have couple of small comments:

* The change in StatementReply.readOpenQuery method to catch SQLExceptions and call one of the completeAbnormalUnitOfWork methods may not be okay in all cases. I think this is a general catch block and there could be SQLExceptions which are not because of a ABNUOWRM. So it may not be okay to call completeAbnormalUnitOfWork methods here. I think it may be better to move these calls to case where we receive ABNUOWRM. 

* In the new method NetConnectionReply.parseAbnormalEndUow(StatementCallbackInterface statement), the parameter 'statement' is not being used anywhere. 









> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

V.Narayanan updated DERBY-694:
------------------------------

    Attachment: DERBY-694_upload_v1.diff
                DERBY-694_upload_v1.stat
                DERBY-694.html

Hi,
please find attached a patch for this issue and also a related explanation. Please note that this patch is only for review and I will post a subsequent patch that will contain unit tests for the changes and also address any comments I receive for this patch.

thanx ,
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

Oyvind Bakksjo updated DERBY-694:
---------------------------------

    Attachment: StatementRollbackTest.java

Attached program which demonstrates the bug.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>          Key: DERBY-694
>          URL: http://issues.apache.org/jira/browse/DERBY-694
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Versions: 10.1.1.1
>     Reporter: Oyvind Bakksjo
>     Priority: Minor
>  Attachments: StatementRollbackTest.java
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12423607 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

Hi,
Please accept my apologies for having attached DERBY-694_V3.diff without having logged in. it generated a email that said there was a attachement from an anonymous person. I was the one who attached it.

Thanx a ton for going through the patch and giving the comments. I have modified the patch as per request. 

I agree that if an ABNUOWRM were to be caused from a operation a lob it would result in the bug. But I am unable to generate a ABNUOWRM from a lob operation. Does anyone have a suggestion to do this?

thanx
Narayanan  

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

V.Narayanan updated DERBY-694:
------------------------------

    Attachment: DERBY-694_v5.diff
                DERBY-694_v5.stat

Hi,
I have converted the repro attached with this issue into a unit test. Otherwise the patch is the same as the previous submitted.

Since the changes are only in the NetworkClient side, I ran derbynetclientmats which ran fine sans wisconsin noise. I also ran upgrade tests. It ran clean.

Can someone kindly review this patch and give me their comments and if they find it fit recommend it for a commit or commit it.

thanx 
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

V.Narayanan updated DERBY-694:
------------------------------

    Attachment: DERBY-694_v4.diff
                DERBY-694_v4.stat

I was earlier checking for the severity of the exception by,

netSqlca.getSqlCode() > ExceptionSeverity.STATEMENT_SEVERITY

I realized that a better way of doing this would be 

ExceptionUtil.getSeverityFromIdentifier(netSqlca.getSqlState()) >
ExceptionSeverity.STATEMENT_SEVERITY

I can get the SQLState of the exception from netSqlca.getSqlState(). I understood the NetSqlca class as holding the values of the parsing of SQLCA obtained from a ABNUOWRM. The severity of this exception can be derived using the method 
ExceptionUtil.getSeverityFromIdentifier. This can then be used to ensure that the severity of the exception is lesser than STATEMENT_SEVERITY.

I have modified my patch to do this. I am submitting the same.

What I not been able to do is to generate an ABNUOWRM with a severity > STATEMENT_SEVERITY. I will however submit a patch testing the case pointed out in this issue after running derbyall by tomorrow.

thanx
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12421705 ] 
            
Rick Hillegas commented on DERBY-694:
-------------------------------------

Hi, Narayanan. Thanks for tackling this bug and for the explanatory html page. I am far from being an expert on this corner of the code. However, the following issues jump occur to me:

1) I don't see a regression test case for this problem. Please add a test case to derbyall.

2) Shouldn't Connection.completeSpecificRollback( UnitOfWorkListener uwl ) call uwl.completeLocalRollback() just as Connection.completeLocalRollback() does? It may be that the UnitOfWorkListener.completeLocalRollback() in question is a NOP right now, but that could change in the future.

3) I am wondering whether this fixes the whole bug. Should similar logic be added to network ResultSets as well as Statements? What happens if we get a STATEMENT_SEVERITY exception while calling a ResultSet method?


> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12426850 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

I ran the repro attached with the IBM JDBC Universal Driver. I had'nt done this before. I noticed that it showed behaviour similar to what is currently happening in the Derby ClientDriver (i.e.) a statement exception was causing all the connections result sets to be closed. Then I ran the test in the DerbyNet framework which is specific to the IBM JDBC Universal driver. As expected it failed. 

The failure seems to be specific to the DerbyNet framework and to the IBM JDBC Driver. 

I will overcome this by submitting a fresh patch that will exclude this test from running in the DerbyNet framework. 

thanx
Narayanan



> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12428355 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

Hi,
Thank you for highlighting DERBY-705. I will take a look at it!
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12423395 ] 
            
Rick Hillegas commented on DERBY-694:
-------------------------------------

Hi Narayanan. Thanks for these improvements. I have a couple comments:

1) It seems to me that the code would be simpler if StatementCallbackInterface and ResultSetCallbackInterface extended UnitOfWorkListener. If you make that change, then it suggests that getConnectionCallbackInterface() might move up to UnitOfWorkListener. What stands in the way there is that the Lobs implement UnitOfWorkListener but don't have a getConnectionCallbackInterface() method. But this makes me wonder whether this bug could surface when you call methods on Lobs?

2) I'm a little puzzled about the uwl field in NetConnectionReply and how it is set by the two new parseAbnormalEndUow() overloads before they forward to the old overload. This breaks the general pattern of the methods in this class, which seem to pass variables through method arguments rather than through state variables. It makes me uneasy.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12426774 ] 
            
Rick Hillegas commented on DERBY-694:
-------------------------------------

I'm afraid that I see the following diff in the jdbc4 tests now. I ran this on linux.

********* Diff file derbyall/derbynetmats/DerbyNet/jdbcapi/ResultSetCloseTest.diff
*** Start: ResultSetCloseTest jdk1.4.2_08 DerbyNet derbynetmats:jdbcapi 2006-08-08 10:29:26 ***
0 add
> .E
> There was 1 error:
> 1) testResultSetDoesNotClose(org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetCloseTest)com.ibm.db2.jcc.c.SqlException: Invalid operation: result set closed
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
Test Failed.


> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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] Closed: (DERBY-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-694.
------------------------------------


> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: https://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.2.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>             Fix For: 10.2.1.6
>
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

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

V.Narayanan reassigned DERBY-694:
---------------------------------

    Assign To: V.Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>          Key: DERBY-694
>          URL: http://issues.apache.org/jira/browse/DERBY-694
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Versions: 10.1.1.1
>     Reporter: Oyvind Bakksjo
>     Assignee: V.Narayanan
>     Priority: Minor
>  Attachments: StatementRollbackTest.java
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12422052 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

Hi,
Thanks a ton for the comments and reviews. 

1) Will add the test case in a fresh patch

2) Yes uwl.completeLocalRollback() should be called in all the places. Removing it from the Map alone would'nt suffice. Thank you for catching this.

3) instead of replicating logic for ResultSets as well as Statements if I push the try catch to where we parse the ABNUOWRM we can avoid replicating.

4) NetConnectionReply.parseAbnormalEndUow(StatementCallbackInterface statement) statement is not necessary. Will remove this.

I will add a test case and also address all the issues pointed out and submit a fresh patch. 

thanx again, 
Narayanan

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12423780 ] 
            
V.Narayanan commented on DERBY-694:
-----------------------------------

The following test cases would test the patch in greater detail

1) Generate a case which will cause a ABNUOWRM that will cause the severity to be greater than 
     STATEMENT_SEVERITY. I tried a case that cause a timeout. This is what I did in the test case
     1.a) created connection1 set transaction isolation level as Connection.TRANSACTION_SERIALIZABLE
     1.b) set auto commit to false
     1.c) created a prepared statement to update a table
     1.d) executed the prepared statement
     1.e) created connection2 and a prepared statement from it and did a select from the same  table without    
           commiting the earlier transaction
     1.f) it caused a timeout as expected but did'nt result in a ABNUOWRM
     The test case that currently shows how this bug occurs would work fine if the patch were applied (i.e) the      
     result sets other than the one in which the division by zero occurs would'nt close but then the case when a 
    severity of greater than STATEMENT_SEVERITY occurs needs to be tested to ensure that all the 
    UnitOfWorkListeners are rolled back.

2) We also need a test case that would casue an ABNUOWRM from a Lob object. This would help us test 
     whether the above bug occurs with Lob objects.

I have'nt been able to generate cases 1 and 2. The test suite for the patch would'nt be complete without the above cases. I most humbly request for inputs from anyone who knows how to generate the above cases.

thanx
Narayanan


> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12426915 ] 
            
Rick Hillegas commented on DERBY-694:
-------------------------------------

Thanks for all of this thoughtful work, Narayanan. This improves the situation. Committed at revision 430051.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, DERBY-694_v2.diff, DERBY-694_v2.stat, DERBY-694_v3.diff, DERBY-694_v3.stat, DERBY-694_v4.diff, DERBY-694_v4.stat, DERBY-694_v5.diff, DERBY-694_v5.stat, DERBY-694_v6.diff, DERBY-694_v6.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "Andreas Korneliussen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12421848 ] 
            
Andreas Korneliussen commented on DERBY-694:
--------------------------------------------

I think a test was disabled in DERBY-506. According to DERBY-705, it can be enabled once this issue has been fixed. I do not know if that test is for testing this specific issue, or if it just failed due to this bug.

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-694
>                 URL: http://issues.apache.org/jira/browse/DERBY-694
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.1.1
>            Reporter: Oyvind Bakksjo
>         Assigned To: V.Narayanan
>            Priority: Minor
>         Attachments: DERBY-694.html, DERBY-694_upload_v1.diff, DERBY-694_upload_v1.stat, StatementRollbackTest.java
>
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

-- 
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-694) Statement exceptions cause all the connection's result sets to be closed with the client driver

Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-694?page=comments#action_12419265 ] 

V.Narayanan commented on DERBY-694:
-----------------------------------

When a exception(in the attached file divide by zero) occurs upon statement execution it results in calling a Connection.completeLocalRollback.


The completeLocalRollback method does the following

	java.util.Set keySet = CommitAndRollbackListeners_.keySet();
    	for (java.util.Iterator i = keySet.iterator(); i.hasNext();) {
            UnitOfWorkListener listener = (UnitOfWorkListener) i.next();
            listener.completeLocalRollback(i);
        }
        inUnitOfWork_ = false;

There are three implementations of the UnitOfWorkListener interface Lob,Statement and ResultSet. Each time an object of this type is created they are register themselves to the connection by doing the following

agent_.connection_.CommitAndRollbackListeners_.put(this,null);

An exception like the one (divide by zero) upon statement execution would result in all the above objects being closed . This results in the above bug. My fix would aim at not doing a completeLocalRollback since this would not be necessary but instead closing only the specific Statement which is responsible for this exception. 

> Statement exceptions cause all the connection's result sets to be closed with the client driver
> -----------------------------------------------------------------------------------------------
>
>          Key: DERBY-694
>          URL: http://issues.apache.org/jira/browse/DERBY-694
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Versions: 10.1.1.1
>     Reporter: Oyvind Bakksjo
>     Assignee: V.Narayanan
>     Priority: Minor
>  Attachments: StatementRollbackTest.java
>
> Scenario:
> Autocommit off. Have two prepared statements, calling executeQuery() on both, giving me two result sets. Can fetch data from both with next(). If one statement gets an exception (say, caused by a division by zero), not only this statement's result set is closed, but also the other open resultset. This happens with the client driver, whereas in embedded mode, the other result set is unaffected by the exception in the first result set (as it should be).

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