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] Commented: (DERBY-694) Statement exceptions cause all the connection's result sets to be closed with the client driver
Date Wed, 05 Jul 2006 11:44:31 GMT
    [ 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


Mime
View raw message