And since a transaction
must guarantee that all writes occur, this increased instability could adversely
affect data integrity.
The standard solution for this problem is to use two message-passing phases as part of a
transaction commit; hence, the protocol used is referred to as a two-phase commit. The
main database first polls each of the participants to determine if they are ready; if they
are, the transactional updates are tentatively sent to them. In the second phase, if all the
participants are in agreement that the messages have properly been received, the
changes are committed. If any of the nodes involved in the transaction cannot verify
receipt of the changes, the transactions are rolled back to their original state.
For example, if a transaction is to span databases on machines A, B, and C, in the
first phase of the commit operation, each of the databases is sent the appropriate
transactional update. If each of these machines acknowledges that it has received the
update, the second phase of the update executes the COMMIT command.
Pages:
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671