Previous Topic: Typical Commit FlowsNext Topic: Recovery From Failure


Prepare and Commit Outcomes

When a participant receives a Prepare request, it does whatever is necessary to guarantee that a subsequent Commit request can be honored. This may involve such things as flushing buffers or forwarding requests to other participants. If all of these activities are completed successfully, the participant signals its willingness to commit by responding OK to the Prepare request. If it is unable to successfully complete its preparations, it indicates this by responding BACKOUT to the Prepare request.

The coordinator gathers the responses from its participants and determines the final outcome for the commit operation. If all participants indicate that they are willing to commit, then the coordinator proceeds with the second phase and the transaction will complete successfully as indicated by a final outcome of OK. If any participant indicates that it cannot commit, then the coordinator directs its participants to back out their changes instead of committing them. The final commit outcome in this case is BACKOUT.

A participant can respond to a Prepare request in ways other than OK or BACKOUT. It can respond FORGET to signal that it made no updates within the transaction being committed and so need not participate in the second phase. This has the potential for reducing the number of communications needed to complete the commit operation. A participant can also respond "heuristically", indicating that its resources have already been committed or backed out. A transaction might be completed heuristically because it was forced to complete through some administrative action. Such heuristic actions defeat the two-phase commit process and can lead to mixed outcomes in which some changes are committed while others are backed out.

Note: While CA IDMS does not make heuristic decisions on its own, it does allow an administrator to commit or backout a transaction using a DCMT command, following an interruption in the commit process.