3.3.4.3 Xa_commit
The Xa_commit event MUST be signaled with the following arguments:
XID - XA Transaction Branch Identifier.
RMID - Resource Manager ID.
Flags - Flags defined in [XOPEN-DTP] Chapter 4.4 and section 3.3.1.2 of this document.
The Xa_commit event MUST return the following value:
XA Result- Return code defined in [XOPEN-DTP] Chapter 4.5.
If the Xa_commit event is signaled, the XA Superior Transaction Manager MUST perform the following actions:
If Flags provided has TMASYNC set:
Return XAER_ASYNC.
Otherwise:
Attempt to find an XA Superior Proxy object in the XA Superior Proxy Table corresponding to the provided RMID.
If the XA Superior Proxy object is not found:
Return XAER_RMFAIL.
Otherwise:
Attempt to find an XA Transaction Object corresponding to the provided XID in the XA Transaction Table referenced by the located XA Superior Proxy object.
If the XA Transaction Object is found:
Use this as the XA Transaction for the remaining steps.
Otherwise:
Attempt to create a new XA Transaction Object with the following values:
XID field set to the provided XID.
Thread Identifier field set to the identifier of the current thread of control.
Migrate field set to FALSE.
State field set to Suspended.
The Require Thread Affinity field SHOULD be set to whether Flags does not have TM_NOTHREADAFFINITY set.<15>
Parent XA Superior Proxy object reference set to located XA Superior Proxy object.
If failed:
Return XAER_RMERR.
Otherwise:
Add this XA Transaction Object to the XA Transaction Table referenced by the located XA Superior Proxy object.
Use this as the XA Transaction for the remaining steps.
If Branch Isolation field of located XA Superior Proxy object is set to Tight:
Attempt to create an XA Transaction CMP Connection with the following settings:
Connection Type field set to CONNTYPE_XAUSER_XACT_BRANCH_OPEN.
XA Transaction Object set to the located or created XA Transaction Object.
State field set to Awaiting Open Response.
If Successful:
Set State field of located or created XA Transaction Object to Opening.
If provided Flags have TMONEPHASE set:
Set Action to Prepare Single Phase.
Otherwise:
Set Action to Commit.
Send an XAUSER_XACT_MTAG_OPEN message with the following values:
The guidXaRm field set to the Resource Manager Recovery GUID field of the located XA Superior Proxy object.
The lenXAIdentifier field of the XA_UOW structure (section 2.2.1.4) in the XAUow field set to the size of an XA_XID structure (section 2.2.1.3).
The XAIdentifier field of the XA_UOW structure in the XAUow field set to the provided XID.
Wait for a response and continue with the processing rules defined in CONNTYPE_XAUSER_XACT_BRANCH_OPEN Initiator (section 3.3.5.6).
Otherwise:
Return XA_RMFAIL.
Otherwise:
Attempt to create an XA Transaction CMP Connection with the following settings:
Connection Type field set to CONNTYPE_XAUSER_XACT_OPEN.
XA Transaction Object set to the located or created XA Transaction Object.
State field set to Awaiting Open Response.
If Successful:
Set State field of located or created XA Transaction Object to Opening.
If provided Flags have TMONEPHASE set:
Set Action to Prepare Single Phase.
Otherwise:
Set Action to Commit.
Send an XAUSER_XACT_MTAG_OPEN message with the following values:
The guidXaRm field set to the Resource Manager Recovery GUID field of the located XA Superior Proxy object.
The lenXAIdentifier field of the XA_UOW structure (section 2.2.1.4) in the XAUow field set to the size of an XA_XID structure (section 2.2.1.3).
The XAIdentifier field of the XA_UOW structure in the XAUow field set to the provided XID.
Wait for a response and continue with the processing rules specified in CONNTYPE_XAUSER_XACT_OPEN Initiator (section 3.3.5.3).
Otherwise:
Return XA_RMFAIL.