3.3.4.9 Xa_recover
The Xa_recover event MUST be signaled with the following arguments:
XID Array - Array into which recovered XIDs are to be placed.
Count - Maximum number of XIDs to be returned.
RMID - Resource Manager ID.
Flags - Flags defined in [XOPEN-DTP] Chapter 4.4.
The Xa_recover event MUST return the following value:
XA Result - If successful, the number of XIDs being returned. If unsuccessful, a return code defined in [XOPEN-DTP] Chapter 4.5.
If the Xa_recover event is signaled, the XA Superior Transaction Manager MUST perform the following actions:
If the provided Count field is less than 1:
Return XAER_INVAL.
Attempt to find an XA Superior Proxy object in the XA Superior Proxy Table keyed by the provided RMID.
If an object found:
If the State of the Transaction Manager Connection referenced by the XA Superior Proxy object is not set to Active:
Return XAER_RMFAIL.
Otherwise:
Create a RequestFlags variable with no flags set initially.
SHOULD<21> test if the Recovery Complete field of the found XA Superior Proxy object is set to TRUE and the provided Flags field does not have TMSTARTRSCAN set:
Return 0.
If TMSTARTRSCAN is set in the provided Flags field:
SHOULD<22> set the Recovery Complete field of the found XA Superior Proxy object to FALSE.
Set the Recovery Return Number field of the found XA Superior Proxy object to 0.
Set the XARECOVER_START_SCAN flag in the RequestFlags variable.
Otherwise:
If TMENDRSCAN is set in the provided Flags field:
Otherwise:
Set the XARECOVER_CONTINUE_SCAN flag in the RequestFlags variable.
If the provided Flags field is not set to TMNOFLAGS:
SHOULD<25> return XAER_INVAL.
Set the XARECOVER_CONTINUE_SCAN flag in the RequestFlags variable.
SHOULD set the Recovery Request Number field of the found XA Superior Proxy object to a minimum value between an implementation-specific value and provided Count.<26>
Set the Recovery Max Return field of the found XA Superior Proxy object to the provided Count field.
Set the Transaction Manager Connection's State to Awaiting Recovery Response.
Set the Recovery Array field of the found XA Superior Proxy object to reference the provided XID Array.
Using the Transaction Manager Connection, send an XAUSER_CONTROL_MTAG_RECOVER message with the following values:
The RequestFlags field is set to the created the RequestFlags variable.
The totalUOWsRequested field SHOULD be set to a minimum value between an implementation-specific value and the provided Count field.<27>
Wait for a response and continue with the processing rules defined in CONNTYPE_XAUSER_CONTROL Initiator (section 3.3.5.1).
Otherwise:
Return XAER_RMFAIL.