jungm opened a new pull request, #2950:
URL: https://github.com/apache/tomee/pull/2950

   Fixes [TOMEE-4711](https://issues.apache.org/jira/browse/TOMEE-4711): every 
Jakarta Data repository call from a `@Transactional` CDI method fails with 
`IllegalStateException: Can't use UserTransaction from @Transactional call`.
   
   `RepositoryInvocationHandler.executeInTransaction` used `UserTransaction` to 
check for and start a transaction. [Jakarta Transactions 2.0 
ยง3.7](https://jakarta.ee/specifications/transactions/2.0/jakarta-transactions-spec-2.0#transactional-annotation)
 requires any `UserTransaction` call inside `@Transactional` (other than 
`NOT_SUPPORTED`/`NEVER`) to throw, so the handler now uses the container 
`TransactionManager`. It also only begins its own transaction when there is 
none, rather than whenever the status isn't `ACTIVE`, so a transaction marked 
for rollback is joined instead of hitting a nested `begin()`.
   
   New `JakartaDataTransactionalTest` calls `insert`, `findById`, `save` on a 
loaded entity, and `deleteById` from `@Transactional` methods. All three tests 
fail without the fix and pass with it; the existing data tests and the module's 
unit tests still pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to