Editar

Compartilhar via


Generating and Setting LUWIDs]

The unit-of-work identifier (LUWID) is used to identify conversations that are part of a single Sync Point transaction. All conversations with the same LUWID are committed (or backed out) at the same time.

Host Integration Server assigns two LUWIDs to a transaction program when the TP is started. For locally started TPs, this is when the TP_STARTED verb is issued. The first LUWID is the TP's protected LUWID. It is used by Host Integration Server as the LUWID for all synclevel AP_SYNCPT conversations allocated by the TP. When the TP issues an ALLOCATE or MC_ALLOCATE verb with a synclevel of AP_SYNCPT, Host Integration Server generates an Attach containing the TP's current protected LUWID.

The second LUWID is the TP's unprotected LUWID. It is used on all conversations allocated by the TP with a synclevel other than AP_SYNCPT.

For remotely initiated TPs, the incoming Attach may contain an LUWID for the TPit is mandatory if the conversation has a synclevel of AP_SYNCPT. For Sync Point conversations, Host Integration Server saves the LUWID as the TP's protected LUWID and generates a new unprotected LUWID for it. For conversations with a synclevel other than Sync Point (AP_SYNCPT), Host Integration Server saves the LUWID as the TP's unprotected LUWID and generates a new protected LUWID.

Host Integration Server generates LUWIDs by concatenating the following:

  • The fully qualified name of the local LU, preceded by a single byte indicating its length (exclusive of the length byte).

  • A 6-byte LUW instance number, generated from the current date and time (modified to ensure uniqueness if necessary).

  • A 2-byte LUW sequence number, initialized to 1.

    If the fully qualified LU name component of the LUWID is not 17 bytes long, Host Integration Server does not add any padding between it and the LUW instance number. The application can determine the length of the LUWID, and the offsets within it of the LUW instance number and LUW sequence number, by examining the first byte of the LUWID, which indicates the length of the fully qualified LU name.

    When Host Integration Server generates both a protected and an unprotected LUWID for a TP, the unprotected LUWID is created by incrementing the protected LUWID's instance number.

    The protected LUWID needs to be changed by a TP for one of four reasons:

  • When a transaction is backed out or committed, the LUWID sequence number must be incremented.

  • If the transaction tree is split, a new LUWID must be generated for the TP.

  • If the application uses multiple logical TPs to implement a transaction, each TP must have the same LUWID (different from that assigned by Host Integration Server).

  • If the application is acting as a gateway from a non-SNA environment and LUWIDs are received by a means other than an Attach.

    To allow a TP to set or generate new LUWIDs, a new verb, SET_TP_PROPERTIES, is provided by the APPC API. This verb allows the TP to either set its LUWIDs to an existing value, by providing the LUWIDs, or generate new ones and use them from then on. When a new LUWID is generated by Host Integration Server, it is guaranteed to be unique.

    Note that it is the responsibility of the application (the Sync Point system component) to transmit the new LUWID PS header to the partner Sync Point system when the protected LUWID is changed. Similarly, when a new LUWID PS header is received, the application must inform the LU by issuing SET_TP_PROPERTIES.