Two-phase commitment control
Two-phase commitment control ensures that committable resources on multiple systems remain synchronized.
i5/OS® operating system supports two-phase commit in accordance with the SNA LU 6.2 architecture. For more detailed information about the internal protocols used by the system for two-phase commit, see the SNA Transaction Programmer's Reference for LU Type 6.2, GC30-3084-05. All supported releases of i5/OS operating system support the Presumed Nothing protocols of SNA LU 6.2 and the Presumed Abort protocols of SNA LU 6.2.
Two-phase commit is also supported using TCP/IP as a Distributed Unit of Work (DUW) Distributed Relational Database Architecture™ (DRDA®) protocol. To use TCP/IP DUW connections, all of the systems (both the application requester and the application server) must be at V5R1M0 or newer. For more information about DRDA, see the Open Group Technical Standard, DRDA V2 Vol. 1: Distributed Relational Database Architecture at the Open Group Web site.
Under two-phase commit, the system performs the commit operation in two waves:
- During the prepare wave, a resource manager issues a commit request to its transaction manager. The transaction manager informs any other resources it manages and the other transaction managers that the transaction is ready to be committed. All the resource managers must respond that they are ready to commit. This is called the vote.
- During the committed wave, the transaction manager that initiates the commit request decides what to do, based on the outcome of the prepare wave. If the prepare wave completes successfully and all participants vote ready, the transaction manager instructs all the resources it manages and the other transaction managers to commit the transaction. If the prepare wave does not complete successfully, all the transaction managers and resource managers are instructed to roll back the transaction.
Commit and rollback operations with remote resources
When remote resources are under commitment control, the initiator sends a commit request to all remote agents. The request is sent throughout the transaction program network. Each agent responds with the results of the commit operation.
If errors occur during the prepare wave, the initiator sends a rollback request to all agents. If errors occur during the committed wave, the system attempts to bring as many locations as possible to committed status. These attempts might result in a heuristic mixed state. See States of the transaction for two-phase commitment control for more information about the possible states.
Any errors are sent back to the initiator where they are signaled to the user. If a default journal was specified on the Start Commitment Control (STRCMTCTL) command, C LW entries are written. If errors occur, these entries are written, even if OMTJRNE(*LUWID) was specified. You can use these entries, along with the error messages and the status information for the commitment definition, to attempt to synchronize the committable resources manually.
When remote resources are under commitment control, the initiator sends a rollback request to all remote agents. The request is sent throughout the transaction program network. Each agent responds with the results of the rollback operation.
- Roles in commit processing
If a commit of a transaction involves more than one resource manager, each resource manager plays a role in the transaction. A resource manager is responsible for committing or rolling back changes made during the transaction.
- States of the transaction for two-phase commitment control
A commitment definition is established at each location that is part of the transaction program network. For each commitment definition, the system keeps track of the state of its current transaction and previous transaction.
- Commitment definitions for two-phase commitment control
To change the commitment options for your transaction after you start commitment control, use the Change Commitment Options (QTNCHGCO) API.
Parent topic:
Commitment control concepts
Related concepts
The Open Group Web site
Related reference
Start Commitment Control (STRCMTCTL) command