Class JTASynchronizationListener

  • All Implemented Interfaces:
    jakarta.transaction.Synchronization, SynchronizationListenerFactory

    public class JTASynchronizationListener
    extends AbstractSynchronizationListener
    implements SynchronizationListenerFactory

    Purpose: Synchronization object implementation for JTA 1.0

    Description: Instances of this class are registered against JTA 1.0 transactions. This class may be subclassed to provide specialized behavior for specific transaction implementations. Subclasses must implement the newListener() method to return an instances of the listener subclass.

    See Also:
    JTATransactionController
    • Constructor Detail

      • JTASynchronizationListener

        public JTASynchronizationListener()
        PUBLIC: Used to create factory instances only. Use the "full-bodied" constructor for creating proper listener instances.
      • JTASynchronizationListener

        public JTASynchronizationListener​(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                          org.eclipse.persistence.internal.sessions.AbstractSession session,
                                          Object transaction,
                                          AbstractTransactionController controller)
        INTERNAL: Constructor for creating listener instances (expects all required state info)
    • Method Detail

      • beforeCompletion

        public void beforeCompletion()
        INTERNAL: Called by the JTA transaction manager prior to the start of the transaction completion process. This call is executed in the same transaction context of the caller who initiates the TransactionManager.commit, or the call is executed with no transaction context if Transaction.commit is used.
        Specified by:
        beforeCompletion in interface jakarta.transaction.Synchronization
        Overrides:
        beforeCompletion in class AbstractSynchronizationListener
      • afterCompletion

        public void afterCompletion​(int stat)
        INTERNAL: Called by the JTA transaction manager after the transaction is committed or rolled back. This method executes without a transaction context.
        Specified by:
        afterCompletion in interface jakarta.transaction.Synchronization
        Parameters:
        stat - The status of the transaction completion.