In multiuser database if two users wish to update the same record at the same…
2012
In multiuser database if two users wish to update the same record at the same time, they are prevented from doing so by
Answer: D. Record lock — Concept. In a multiuser DBMS many transactions execute at the same time and their individual read and write steps interleave. If two transactions write the…
- A.
Jamming
- B.
Password
- C.
Documentation
- D.
Record lock
Attempted by 79 students.
Show answer & explanation
Correct answer: D
Concept. In a multiuser DBMS many transactions execute at the same time and their individual read and write steps interleave. If two transactions write the same data item with no control over that interleaving, the later write overwrites the earlier one and the earlier update is lost — the classic lost-update problem. Concurrency control removes that possibility by locking: before a transaction may modify a data item it must acquire an exclusive (write) lock on that item, and the lock manager grants an exclusive lock on an item to at most one transaction at a time.
Application. Trace the two simultaneous updates step by step:
User A issues an update on a particular record, so the lock manager grants A an exclusive lock at record (row) granularity on that record.
At the same instant user B issues an update on the very same record and therefore requests the same exclusive lock on it.
An exclusive lock is incompatible with every other lock on the item, so B's request cannot be granted; B is blocked and waits (a timeout or deadlock-detection policy may abort and restart B instead).
When A commits or rolls back, the lock is released, B acquires it, and B's update is applied to the value A left behind — so neither update is silently lost.
Cross-check. The waiting in step 3 follows directly from the lock-compatibility rule:
Lock already held on the record | Incoming shared (read) request | Incoming exclusive (write) request |
|---|---|---|
Shared (read) | Granted | Waits |
Exclusive (write) | Waits | Waits |
Contrast the other values offered here:
Password — an authentication credential checked when a session connects; it decides which identity may reach the database at all, and two users who have both passed that check can still collide on the same row.
Jamming — deliberate interference transmitted on a radio or network channel; it belongs to communication-link availability, not to database transaction management.
Documentation — data dictionaries, design notes and operating procedures written for human readers; it carries no run-time effect on executing transactions.
Result. The mechanism that stops the two users from updating the same record at the same time is the record lock.