Class XAExceptionUtils

java.lang.Object
io.agroal.narayana.XAExceptionUtils

public abstract class XAExceptionUtils extends Object
  • Constructor Details

    • XAExceptionUtils

      public XAExceptionUtils()
  • Method Details

    • xaException

      public static XAException xaException(int errorCode, String message, Throwable cause)
    • xaException

      public static XAException xaException(int errorCode, Throwable cause)
    • xaException

      public static XAException xaException(int errorCode, String message)
    • xaException

      public static XAException xaException(int errorCode)
    • isUnilateralRollbackOnAbort

      public static boolean isUnilateralRollbackOnAbort(int returnCode, int flags)
      Function that returns true if the returnCode is one of the Rollback-only codes and the flags match TMFAIL.

      This function describes the TMFAIL case from page 38 of The XA Specification:

       The portion of work has failed. A resource manager might choose to mark a
       transaction branch as rollback-only at this point. In fact, a transaction manager
       does so for the global transaction. If a resource manager chooses to do so also,
       xa_end() returns one of the [XA_RB∗] values. TMFAIL cannot be used in
       conjunction with either TMSUSPEND or TMSUCCESS
       
      Parameters:
      returnCode - returnCode that was returned by the RM
      flags - flags that were used to call the method on the XAResource
      Returns:
      true is flags matches TMFAIL and returnCode is one of the defined XA_RB* codes