Interface NonXAResource


public interface NonXAResource
The NonXAResource interface is a Java mapping of the Logging Last Resource(LLR) which is not a xa resource and need to participate in the XA transaction

The NonXAResource interface defines the contract between a NonXA Resource Manager and a Transaction Manager in a distributed transaction processing (DTP) environment. NonXA participant needs to implement this interface for participating in the global transaction.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    begin(Xid xid)
     
    void
    commit(Xid xid, byte[] commitRecord)
    Informs the Non XA resource manager to commit the local transaction changes
    boolean
    This method is called to determine if the Non XA resource manager instance represented by the target object is the same as the Non XA resouce manager instance represented by the parameter nxares.
    List<byte[]>
    Obtains a list of commit records persisted by the NonXaResource manager
    void
    Informs the Non XA resource manager to roll back the local transaction
  • Method Details

    • begin

      void begin(Xid xid) throws NonXAException
      Throws:
      NonXAException
    • commit

      void commit(Xid xid, byte[] commitRecord) throws NonXAException
      Informs the Non XA resource manager to commit the local transaction changes
      Parameters:
      xid - A global transaction identifier
      commitRecord - Transaction commit record to be persisted at the Non XA resource end. It needs to be retuened as part fo recovery call
      Throws:
      NonXAException - An error has occurred.
    • rollback

      void rollback(Xid xid) throws NonXAException
      Informs the Non XA resource manager to roll back the local transaction
      Parameters:
      xid - A global transaction identifier.
      Throws:
      NonXAException - An error has occurred.
    • recover

      List<byte[]> recover() throws NonXAException
      Obtains a list of commit records persisted by the NonXaResource manager
      Returns:
      The resource manager returns zero or more commit records that are persisted after succesful commit of the LLR transactions
      Throws:
      NonXAException - An error has occurred.
    • isSameRM

      boolean isSameRM(NonXAResource nxares) throws NonXAException
      This method is called to determine if the Non XA resource manager instance represented by the target object is the same as the Non XA resouce manager instance represented by the parameter nxares.
      Parameters:
      nxares - An NonXAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.
      Returns:
      true if it's the same RM instance; otherwise false.
      Throws:
      NonXAException - An error has occurred.