Hi everybody,

I write to this mailing list because I reported ARIES-1783
<https://issues.apache.org/jira/browse/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
<https://github.com/apache/aries-jpa/pull/2>) 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()
<https://github.com/CodingFabian/hibernate-core/blob/03ecaba4b035dd8f4ad1b506dd8ebd73ff3d77f8/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/TransactionCoordinatorImpl.java#L160>,
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

Reply via email to