aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Pitts (JIRA)" <>
Subject [jira] [Commented] (ARIES-1497) jpa-support XAJpaTemplate does not properly handle RollbackException
Date Mon, 15 Feb 2016 18:14:18 GMT


Matthew Pitts commented on ARIES-1497:

I'm not 100% confident in my the mock tests in my patch. Please review for any problems.

> jpa-support XAJpaTemplate does not properly handle RollbackException
> --------------------------------------------------------------------
>                 Key: ARIES-1497
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: JPA
>    Affects Versions: jpa-2.3.0
>            Reporter: Matthew Pitts
>         Attachments: jpa-support-RollbackException-handling.patch
> There are a couple of problems addressed here: 
> 1. No checked exceptions ever reach the safeRollback method in XAJpaTemplate. This is
due to the fact that safeFinish catches and wraps via wrapThrowable. This means that the shouldRollback
logic will always (or almost always) be true, because no checked exceptions have the opportunity
to bubble-up as-is from safeFinish.
> 2. Because of the above problem, javax.transaction.RollbackException events are not properly
handled since they result in another rollback attempt.
> The proposed fix (and patch) is to allow RollbackExceptions to bubble up from safeFinish,
thus allowing for their direct passing to safeRollback. Basically, because this is a checked
exception, shouldRollback will be false during safeRollback handling, thus preventing a rollback
attempt while this exception is propagating. Additionally, because safeRollback calls safeFinish
which ultimately calls the corresponding TransactionAttribute.finish method, then the logic
therein to issue a rollback in the event of STATUS_MARKED_ROLLBACK will be executed when this
exception is propagating. Thus, no other special handling is really required.
> Please validate and correct my statement of the problem and my fix.

This message was sent by Atlassian JIRA

View raw message