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.

@FunctionalInterface public interface JtaTransactionLookup
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

    Modifier and Type
    Method
    Description
    boolean
    active(Context context)
    Reports whether the request has a JTA transaction an EntityManager can join.
  • Method Details

    • active

      boolean active(Context context)
      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