aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Ward <>
Subject Re: ARIES-1783 TransactionRequiredException when non-transactional method precedes a transactional one in the same service.
Date Wed, 11 Apr 2018 14:26:05 GMT

I’m afraid that the answer to this is non-trivial.

Section 3.3 of the JPA specification indicates that In the case of a Transaction scoped persistence
context you should be getting a new entity manager instance in the new transaction (i.e. not
calling joinTransaction). 

In the case of an extended scope persistence context then it should join the current transaction
if the entity manager is not already joined to the current transaction



> On 15 Mar 2018, at 16:26, Daniel Estermann <> wrote:
> Hi everybody,
> I write to this mailing list because I reported ARIES-1783
> <> and also tried to
> investigate why the exception occurs.
> Both in our productive environment as well as in the integration tests (for
> which I created a test in my pull request
> <>) I came to the same
> conclusion: In the subject case the exception occurs, because the join
> status of the transaction is NOT_JOINED. I discovered it by looking at
> TransactionCoordinatorImpl#isTransactionInProgress()
> <>,
> which returns false.
> What seems to help is to call joinTransaction() on the EntityManager in the
> beginning of a method annotated with REQUIRES_NEW. However I can't tell if
> that would be a proper fix. It feels at least not as proper solution.
> I would appreciate any support on that issue.
> Kind Regards
> Daniel

View raw message