Interface TransactionServices

All Superinterfaces:
Service

public interface TransactionServices extends Service

The container must implement the services related to transactional behavior used in JSR-299, if that behavior is going to be used.

The event framework specified by CDI includes the ability to create observer methods which are activated based on the phase and status of a currently active transaction. In order to use these abilities, the container must provide these intermediary services which in turn may interact with an application server and JTA.

Required in a Java EE environment

TransactionServices is a per-deployment service.

Author:
David Allen
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.transaction.UserTransaction
    Obtain a reference to the JTA UserTransaction
    boolean
    Queries the status of the current execution to see if a transaction is currently active.
    void
    registerSynchronization(jakarta.transaction.Synchronization synchronizedObserver)
    Registers a synchronization object with the currently executing transaction.

    Methods inherited from interface org.jboss.weld.bootstrap.api.Service

    cleanup
  • Method Details

    • registerSynchronization

      void registerSynchronization(jakarta.transaction.Synchronization synchronizedObserver)
      Registers a synchronization object with the currently executing transaction.
      Parameters:
      synchronizedObserver - the synchronization
      Throws:
      RuntimeException - if a problem occurs during registration, the Throwable.getCause() should return the original exception so that Weld could easily distinguish possible registration problems
      See Also:
      • Synchronization
    • isTransactionActive

      boolean isTransactionActive()
      Queries the status of the current execution to see if a transaction is currently active.
      Returns:
      true if a transaction is active
    • getUserTransaction

      jakarta.transaction.UserTransaction getUserTransaction()
      Obtain a reference to the JTA UserTransaction
      Returns:
      a reference to the JTA UserTransaction