aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (ARIES-1497) jpa-support XAJpaTemplate does not properly handle RollbackException
Date Mon, 02 Jan 2017 17:19:58 GMT


ASF subversion and git services commented on ARIES-1497:

Commit 1776966 from [] in branch 'aries/trunk'
[ ]

[ARIES-1497] Cleanup test dependencies

> 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
>            Assignee: Christian Schneider
>         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