ITPEC FE Morning April 2018 Question 30
In a distributed database system, which of the following is a method for the finalization of update processing when an inquiry is made to multiple sites that perform a series of transaction processes as to whether finalization is possible or not and whether finalization is possible at all sites?
Explanation
Two-phase commitment — the coordinator first asks every site whether it can commit, and commits only if all of them say yes.
A transaction that updates several sites must be committed everywhere or nowhere.
- Phase 1 (prepare): the coordinator asks each site whether it can finalize; each site gets ready to commit and replies yes or no.
- Phase 2 (commit): if every site answered yes, the coordinator tells all of them to commit; if any site answered no, it tells all of them to roll back.
The inquiry to all sites about whether finalization is possible is exactly phase 1.
Answer (d)
Why not others:
- •(a) Exclusive control — locking that stops concurrent transactions from updating the same data; it does not coordinate a commit across sites
- •(b) Roll back — undoes a transaction's updates using the before-images in the log; it is one possible outcome of phase 2, not the method
- •(c) Roll forward — recovery that reapplies committed updates from the log after a failure
Key rule: A distributed commit needs a vote before the decision: prepare everywhere first, then commit everywhere or roll back everywhere.
Databases · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.