Class LocalTransaction

  • All Implemented Interfaces:
    jakarta.transaction.Transaction

    public final class LocalTransaction
    extends AbstractTransaction
    A transaction from a local transaction provider.
    Author:
    David M. Lloyd
    • Method Detail

      • commit

        public void commit()
                    throws jakarta.transaction.RollbackException,
                           jakarta.transaction.HeuristicMixedException,
                           jakarta.transaction.HeuristicRollbackException,
                           SecurityException,
                           jakarta.transaction.SystemException
        Specified by:
        commit in interface jakarta.transaction.Transaction
        Specified by:
        commit in class AbstractTransaction
        Throws:
        jakarta.transaction.RollbackException
        jakarta.transaction.HeuristicMixedException
        jakarta.transaction.HeuristicRollbackException
        SecurityException
        jakarta.transaction.SystemException
      • getStatus

        public int getStatus()
                      throws jakarta.transaction.SystemException
        Throws:
        jakarta.transaction.SystemException
      • enlistResource

        public boolean enlistResource​(XAResource xaRes)
                               throws jakarta.transaction.RollbackException,
                                      IllegalStateException,
                                      jakarta.transaction.SystemException
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • registerSynchronization

        public void registerSynchronization​(jakarta.transaction.Synchronization sync)
                                     throws jakarta.transaction.RollbackException,
                                            IllegalStateException,
                                            jakarta.transaction.SystemException
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • getParentName

        public String getParentName()
        Get the name of the node which initiated the transaction.
        Returns:
        the name of the node which initiated the transaction, or null if it could not be determined
      • getXid

        public Xid getXid()
        Get the XID of the local transaction.
        Returns:
        the transaction XID (not null)
      • isImported

        public boolean isImported()
        Determine if this transaction was imported.
        Returns:
        true if the transaction was imported, false if it was initiated locally
      • getProviderInterface

        public <T> T getProviderInterface​(Class<T> providerInterfaceType)
        Description copied from class: AbstractTransaction
        Get a provider-specific interface from this transaction.
        Overrides:
        getProviderInterface in class AbstractTransaction
        Type Parameters:
        T - the provider interface type
        Parameters:
        providerInterfaceType - the provider interface type class (must not be null)
        Returns:
        the provider interface, or null if the given type isn't supported by this transaction's provider
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object