3.3.4.10 Xa_rollback
The Xa_rollback event MUST be signaled with the following arguments:
XID - XA Transaction Branch Identifier.
RMID - Resource Manager ID.
Flags - Flags defined in Chapter 4.4 of [XOPEN-DTP] and section 3.3.1.2 of this document.
The Xa_rollback event MUST return the following value:
XA Result - Return code defined in [XOPEN-DTP] Chapter 4.5.
If the Xa_rollback event is signaled, the XA Superior Transaction Manager MUST perform the following actions:
If the provided Flags field has TMASYNC set:
Return XAER_ASYNC.
Otherwise:
Attempt to find an XA Superior Proxy object in the XA Superior Proxy Table keyed by the provided RMID.
If an object is not found:
Return XAER_RMFAIL.
Otherwise:
Attempt to find an XA Transaction Object in the XA Transaction Table referenced by the XA Superior Proxy object keyed by the provided XID.
If an object is found:
Use this as the XA Transaction.
Otherwise:
Attempt to create a new XA Transaction Object with the following values:
The XID field is set to the provided XID.
The Thread Identifier field is set to the Current Thread ID.
The Migrate field is set to FALSE.
The State field is set to Suspended.
If the provided Flags field has TM_NOTHREADAFFINITY set:<28>
Set the Require Thread Affinity field to TRUE.
Otherwise:
Set the Require Thread Affinity field to FALSE.
The Parent XA Superior Proxy object is set to XA Superior Proxy object.
If failed:
Return XAER_RMERR.
Otherwise:
Use this as the XA Transaction Object.
If the found XA Superior Proxy object has Branch Isolation field set to Tight:
Create a new XA Transaction CMP Connection object with the following values:
The connection type field is set to CONNTYPE_XAUSER_XACT_BRANCH_OPEN.
The XA Transaction Object is set to created XA Transaction Object.
The State field set to Awaiting Open Response.
The State field of the XA Transaction Object is set to Opening.
The Action field is set to Rollback.
Send an XAUSER_XACT_MTAG_OPEN message with the following values:
The guidXaRm is set to the Resource Manager Recovery GUID field of the found XA Superior Proxy object.
The lenXAIdentifier field of the XA_UOW structure (section 2.2.1.4) in the XAUow field is set to size of an XA_XID structure (section 2.2.1.3).
The XAIdentifier field of the XA_UOW structure in the XAUow field is set to the provided XID field.
Wait for a response and continue with the processing rules defined in CONNTYPE_XAUSER_XACT_BRANCH_OPEN Initiator (section 3.3.5.6).
Otherwise:
Attempt to create a new XA Transaction CMP Connection object with the following values:
The Connection type field is set to CONNTYPE_XAUSER_XACT_OPEN.
The XA Transaction Object is set to the created XA Transaction Object.
The State field is set to Awaiting Open Response.
The Action field is set to Rollback.
If failed:
Return XAER_RMERR.
The State field of the XA Transaction Object is set to Opening.
Send an XAUSER_XACT_MTAG_OPEN message with the following values:
The guidXaRm is set to the Resource Manager Recovery GUID field of the found XA Superior Proxy object.
The lenXAIdentifier field of the XA_UOW structure in the XAUow field is set to the size of an XA_XID structure.
The XAIdentifier field of the XA_UOW structure in the XAUow field is set to the provided XID field.
Wait for a response and continue with the processing rules defined in CONNTYPE_XAUSER_XACT_OPEN Initiator (section 3.3.5.3).