db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "V.Narayanan (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-694) Statement exceptions cause all the connection's result sets to be closed with the client driver
Date Tue, 25 Jul 2006 10:47:14 GMT
     [ 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

        

Mime
View raw message