Package com.jsgalactic.axiom.jpa
Interface JtaTransactionLookup
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Reports whether a request already carries an active JTA transaction.
An application that has a JTA module supplies a callback that reads that module's own
request-scoped state, for example Jta::active. No JTA type appears in this interface and
axiom-jpa has no dependency on the module that supplies the transaction. Without a
callback this adapter always manages a resource-local transaction itself.
The callback runs on the request thread while the EntityManager is being opened. It must be thread-safe and must not retain the context. A callback that throws fails the request.
-
Method Summary
-
Method Details
-
active
Reports whether the request has a JTA transaction an EntityManager can join.- Parameters:
context- the request being served- Returns:
- true to call
EntityManager.joinTransaction()instead of starting a local transaction
-