Commitment definition for two-phase commit: Not select a last agent

 

By default, the transaction manager for the initiator is free to select any agent as a last agent during a commit operation.

The Not select last agent option does not apply if you are using a DRDA® distributed unit of work over TCP/IP connection.

In case of a multi-level tree, any agent selected as a last agent by its initiator is also free to select a last agent of its own. Performance is improved when a last agent is selected during the commit operation because two communications flows are eliminated between an initiator and its last agent (the prepare phase is eliminated for these systems).

However, when the initiator sends the request commit to its last agent, it must wait until it has received the last agent's vote before it can continue. This is regardless of the Wait for outcome value for the commitment definition. During normal, error-free commit processing, this is not an issue. But, if an error occurs during this window, the initiator cannot continue until resynchronization completes. If the initiator application is handling requests from a user at a terminal, this can be a usability consideration.

You must consider whether the improved performance during normal commit operations is more important than the impact on usability when such an error occurs. Note that if the error occurs before the request commit is sent to the last agent, the LUW will immediately roll back and the initiator will not wait. Therefore, the window when an error can cause the initiator to wait is quite small, so such an error is rare.

If you decide that the usability impact is not worth the improved performance, you can change your commitment definitions to not select a last agent. After you start commitment control, you can use the Change Commitment Options (QTNCHGCO) API to change the Last agent permitted option to N.

 

Parent topic:

Commitment definitions for two-phase commitment control

 

Related reference


Change Commitment Options (QTNCHGCO) API