db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-4443) Wrap rollback in exception handlers in try-catch
Date Wed, 30 Mar 2011 13:39:05 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012955#comment-13012955
] 

Bryan Pendleton commented on DERBY-4443:
----------------------------------------

Hi Knut Anders, thanks for double-checking that.

I agree that we would prefer to have the original exception lead the stack
trace, with the rollback exception chained on afterwards.

I made your suggested change to rollbackAndThrowSQLException,
and indeed the exception in the stack trace is more relevant to the
original problem.

However, this will require adjusting the test, since now the stack trace
looks different to the assertions in the test code.

I'll hold off on committing while we discuss this further.

> Wrap rollback in exception handlers in try-catch
> ------------------------------------------------
>
>                 Key: DERBY-4443
>                 URL: https://issues.apache.org/jira/browse/DERBY-4443
>             Project: Derby
>          Issue Type: Bug
>          Components: Demos/Scripts, Documentation, Eclipse Plug-in, JDBC, Network Client,
Network Server, Replication, Services, SQL, Test, Tools
>    Affects Versions: 10.5.3.0
>            Reporter: Aaron Digulla
>            Assignee: Houx Zhang
>              Labels: derby_triage10_8
>         Attachments: DERBY-4443-1.patch, DERBY-4443-2.patch, DERBY-4443-3.patch, DERBY-4443-4.patch,
DERBY-4443-4.png, DERBY-4443-5.patch, DERBY-4443.patch
>
>
> Avoid this pattern everywhere:
> 		}catch(SQLException se){
> 			//issue a rollback on any errors
> 			conn.rollback();
> 			throw  se;
> 		}
> because an error in rollback will shadow the original exception.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message