TMF Introduction (G06.26+)
Transaction Coordination
HP NonStop TMF Introduction—522414-002
2-11
Two-Phase Commit Protocol
Two-Phase Commit Protocol
TMF uses a two-phase commit protocol, which ensures that the whole transaction
commits as a unit. In the first phase, TMF asks each participant in the transaction to
prepare to commit. In the second phase, if all participants reply that they are prepared,
TMF asks each participant to commit the change. In this way, transactions are not
committed unless there is a reasonable expectation that the commit will succeed for all
participants. Figure 2-6 illustrates the two-phase commit protocol. Assuming no
failures, the transaction is committed successfully.
Figure 2-6. Two-Phase Commit
Prepare Prepare Commit Commit
Phase 1: Prepare Phase 2: Commit
2
Prepared
3
4
Committed
5
Committed
6
Commit
1
Resource managers reply that they are prepared.
Resource managers commit the transaction and reply to TMF.
2
3
4
5
6
1
Legend
Application asks to commit the transaction.
TMF asks resource managers to prepare to commit.
TMF asks resource managers to commit.
TMF replies to the application that the transaction is committed.
Application
TMF
Application
TMF
Resource
Manager
Resource
Manager
Resource
Manager
Resource
Manager
VST045.vsd