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 "Houx Zhang (JIRA)" <ji...@apache.org> on 2011/04/01 17:01:06 UTC

[jira] [Commented] (DERBY-4443) Wrap rollback in exception handlers in try-catch

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

Houx Zhang commented on DERBY-4443:
-----------------------------------

Knut, I have called getNextException() in several places, such as EmbedPreparedStatement.executeUpdate() in Line 309 of EmbedPreparedStatement, and each of they returned null. I also looked into the trace stack when debugging, and haven't seen rollback exception in it.

Maybe it relates to the simple mocking of InternalDriver and Connection? 



> 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