3.3.5.1.4 Receiving an XAUSER_CONTROL_MTAG_RECOVER_REPLY Message

When the XA Superior Transaction Manager receives an XAUSER_CONTROL_MTAG_RECOVER_REPLY message, it MUST perform the following actions:

  • If the State of the receiving Connection is not set to Awaiting Recovery Response (section 3.3.1.3.4):

    • Signal the Disconnect Connection event using the receiving connection as the argument.

    • Remove the XA Superior Proxy object referenced by the receiving connection from the XA Superior Proxy Table.

  • Otherwise:

    • Set the State of the receiving connection to Active.

    • If the ulTotalUoWs field of the message is greater than Recovery Request Number, the XA Superior Transaction Manager SHOULD perform the following actions:

      • SHOULD<34> return XAER_RMFAIL from an xa_recover call.

      • Signal the Disconnect Connection event using the receiving connection as the argument.

      • Remove the XA Superior Proxy object referenced by the receiving connection from the XA Superior Proxy Table.

    • If the ReplyFlags field of the message has XARECOVER_END_OF_RECS set:

      • Set the Recovery Complete field of the XA Superior Proxy object referenced by the receiving connection.

      • Copy the ulTotalUoWs field of the message number of XIDs from the UoW_Recs field of the message to the Recovery Array of the XA Superior Proxy object referenced by the receiving connection.

      • Increment the Recovery Return Number field of the XA Superior Proxy object referenced by the receiving connection by the ulTotalUoWs field of the message.

      • If the Recovery Return Number field of the XA Superior Proxy object referenced by the receiving connection is set to the value of the Recovery Max Return field of the XA Superior Proxy object referenced by the receiving connection or the ulTotalUoWs field of the message is less than the Recovery Request Number field of the XA Superior Proxy object referenced by the receiving connection:

        • Return the Recovery Return Number field of the XA Superior Proxy object referenced by the receiving connection from xa_recover.

        • Signal the Disconnect Connection event using the receiving connection as the argument.

    • Otherwise:

      • Set the Recovery Request Number field of the XA Superior Proxy object referenced by the receiving connection to the minimum value between an implementation-specific value and the difference between the Recovery Max Return field of the XA Superior Proxy Object referenced by the receiving connection and the Recovery Return Number field of the XA Superior Proxy Object referenced by the receiving connection.<35>

      • Send an XAUSER_CONTROL_MTAG_RECOVER message (section 2.2.4.2.4) with the following values:

        • The RequestFlags field is set to XARECOVER_CONTINUE_SCAN.

        • The totalUOWsRequested field is set to the Recovery Request Number of the XA Superior Proxy object referenced by the receiving connection.

    • Set the State of the receiving connection to Awaiting Recovery Response (section 3.3.1.3.4).