9-22 IBM Informix OnLine Database Server Administrator’s Guide
IBM Informix STAR and Two-Phase Commit Protocol
Example Transaction Rollback

Figure9-5 is a simple representation of a two-phase commit protocol that

resultsin a transaction being rolled back. Notice that the participants do not

senda confirmation to the coordinator when the piece of work is rolled back.

The coordinator does not keep a record that a transaction completed. The

beginning of phase two is considered to be the instant at which the coordi-

nator records its decision—in this case, when the roll back work logical log

record is written to disk.

Figure9-5
Simpleillustration
of a two-phase
commit protocol
that results in a
transaction being
rolled back
End Protocol
Start Protocol
C
P1 P2 P3
C
P1 P2 P3
P1 Participant:
Determines that the commit cannot occur.
Returns message: “cannot commit.”
P2 and P3 Participants:
Determine that the commit can occur.
Record the fact that a commit can occur.
Return message: “can commit.”
Coordinator:
Records decision to begin precommit phase. Sends a “prepare”
message to participants.
All Participants:
Roll back piece of work.
Remove transaction entry from shared-memory transaction table.
Release shared-memory resources.
Coordinator:
Receives “cannot commit” response.
Records decision to roll back the transaction.
Phase 2 Begins:
Rolls back work on behalf of transaction.
Removes transaction entry from shared-memory transaction table.
Releases shared-memory resources.
Sends a “roll back” message to participants.