Interface XAOutflowHandle


  • public interface XAOutflowHandle
    A handle for the outflow of an XA transactional resource.

    In certain circumstances, if all outflowing transactions forget the enlistment or it is owned by another node, the transaction may be resolved at prepare directly with an XA_RDONLY status, or it may be completely removed from the transaction before it completes, allowing more efficient transaction resolution as well as correct behavior in the presence of outflow cycles.

    Author:
    David M. Lloyd
    • Method Detail

      • getRemainingTime

        int getRemainingTime()
        Get an estimated remaining timeout for this transaction.
        Returns:
        the timeout, in seconds (0 indicates that the timeout has likely already expired)
      • forgetEnlistment

        void forgetEnlistment()
        Signal that this enlistment may be forgotten.
      • nonMasterEnlistment

        void nonMasterEnlistment()
        Signal that the peer already had the transaction in question. It may have been created previously by this node, or by another node. When there are no outstanding handles, if the corresponding subordinate enlistment has not been verified, and this method was called at least once, then the enlistment may be assumed to be owned by someone else and subsequent outstanding handles will not prevent the transaction from completing.
      • verifyEnlistment

        void verifyEnlistment()
                       throws RollbackException,
                              SystemException
        Signal that this enlistment should be activated effective immediately. If any outflowing transactions verify the enlistment, then the enlistment is verified for all.
        Throws:
        RollbackException - if the transaction was rolled back before the enlistment could be activated
        SystemException - if the enlistment failed for an unexpected reason
      • getXid

        @NotNull
        Xid getXid()
        Get the XID of the transaction.
        Returns:
        the XID of the transaction (must not be null)
      • createSimple

        static XAOutflowHandle createSimple​(Xid xid,
                                            int timeout)
        Create a simple, no-operation outflow handle.
        Parameters:
        xid - the transaction ID (must not be null)
        timeout - the estimated remaining time, in seconds
        Returns:
        the outflow handle (not null)