ITPEC IP April 2020 Question 29
In a system environment where several users have access to a database simultaneously, a new user tries to view a data record while another user is updating the same record. In order to assure data integrity in such circumstances, which of the following is an appropriate control method that should be used in the DBMS?
Explanation
Let the new user view the record after the update is completed — exclusive control (locking) keeps other users away from a record while it is being updated.
When a transaction starts updating a record, the DBMS locks it. Another user who wants to read that record waits until the update is finished and the lock is released, and then sees complete, consistent data. Letting the reader in midway could show a half-updated record, or a value that is later rolled back.
Answer (c)
Why not others:
- •(a) — interrupting the update to serve a reader leaves the record half-updated, the very inconsistency the control is meant to prevent
- •(b) — reading during the update shows data that is not yet final (a dirty read); if the update is then rolled back, the user has seen a value that never officially existed
- •(d) — cancelling a legitimate update just so that someone can read throws away another user's work; a reader waits for a writer, it does not override it
Key rule: Exclusive control makes concurrent users take turns on the same data: a record being updated is locked, and others access it only after the update is committed or rolled back.
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 IP past-paper collection or Report an issue.