Interface XAImporter

All Superinterfaces:
XARecoverable

public interface XAImporter extends XARecoverable
The API which must be implemented by transaction providers that support transaction inflow.
Author:
David M. Lloyd
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    commit(Xid xid, boolean onePhase)
    Commit an imported (typically prepared) transaction.
    jakarta.transaction.Transaction
    Find an existing transaction on this system.
    findOrImportTransaction(Xid xid, int timeout, boolean doNotImport)
    Import a transaction.
    void
    forget(Xid xid)
    Forget an imported, prepared transaction.
    Xid[]
    recover(int flag, String parentName)
    Initiate a recovery scan.

    Methods inherited from interface org.wildfly.transaction.client.XARecoverable

    recover
  • Method Details

    • findOrImportTransaction

      ImportResult<?> findOrImportTransaction(Xid xid, int timeout, boolean doNotImport) throws XAException
      Import a transaction. If the transaction already exists, it should be returned, otherwise a new transaction should be initiated with the given timeout (in seconds).
      Parameters:
      xid - the transaction ID (must not be null)
      timeout - the remaining transaction timeout, or 0 if the default should be used
      doNotImport - true to indicate that a non-existing transaction should not be imported, false otherwise
      Returns:
      the transaction import result, or null if (and only if) doNotImport is true and the transaction didn't exist locally
      Throws:
      XAException - if the import failed for some reason
    • findExistingTransaction

      jakarta.transaction.Transaction findExistingTransaction(Xid xid) throws XAException
      Find an existing transaction on this system. If no such transaction exists, null is returned. Normally the transaction is located only by global ID.
      Parameters:
      xid - the XID to search for (must not be null)
      Returns:
      the transaction object, or null if the transaction is not known
      Throws:
      XAException - if the transaction manager failed for some reason
    • commit

      void commit(Xid xid, boolean onePhase) throws XAException
      Commit an imported (typically prepared) transaction.
      Specified by:
      commit in interface XARecoverable
      Parameters:
      xid - the transaction ID (must not be null)
      onePhase - true to perform prepare and commit in one operation, false otherwise
      Throws:
      XAException - if the operation fails for some reason
    • forget

      void forget(Xid xid) throws XAException
      Forget an imported, prepared transaction.
      Specified by:
      forget in interface XARecoverable
      Parameters:
      xid - the transaction ID (must not be null)
      Throws:
      XAException - if the operation fails for some reason
    • recover

      @NotNull Xid[] recover(int flag, String parentName) throws XAException
      Initiate a recovery scan.
      Specified by:
      recover in interface XARecoverable
      Parameters:
      flag - one of XAResource.TMSTARTRSCAN, XAResource.TMNOFLAGS, or XAResource.TMENDRSCAN
      parentName - the name of the node to recover on behalf of, or null for all
      Returns:
      the array of recovered XIDs (may be SimpleXid.NO_XIDS, must not be null)
      Throws:
      XAException - if the operation fails for some reason