The methods of the XAResource interface provide the transaction manager with the ability to interact with the resource manager, which consists of the OpenEdge SQL server and the OpenEdge storage engine. The XAResource interface uses the following methods:
Start — The start method works on behalf of a transaction branch specified by global transaction identifier, referred to as an XID. A start specifies that:
A new transaction branch is desired.
There was a request to join a transaction previously seen by the resource manager.
There was a request to resume a suspended transaction.
A request to join or resume an existing transaction does not need to occur on the connection that the new transaction branch was requested. It may occur on a server other than the one that the new transaction branch was requested.
End — The end method ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and lets the transaction complete. The transaction completes in one of three ways:
A transaction is suspended temporarily in an incomplete state and must be resumed via the start method.
A transaction is flagged to indicate that a portion of work has failed. The resource manager marks the transaction as rollback-only.
A transaction ends if that the portion of work has completed successfully.
Prepare — The resource manager is asked to prepare for a transaction commit of the transaction. The request occurs on a connection other than where the work for the transaction branch was executed.
Commit — The resource manager is asked to commit the transaction. The request occurs on a connection other than where the work for the transaction branch was executed.
Rollback — The rollback method prompts the resource manager to roll back the work done for the transaction. The request may occur on a connection other than where the work for the transaction branch was executed.
Recover — The recover method prompts the resource manager for a list of prepared transaction branches. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or in heuristically completed states.