Correct option is A
In a DBMS locking mechanism, multiple transactions can simultaneously hold Shared Locks (S-locks) on the same resource because shared locks are compatible with each other and allow concurrent read operations.
However, an Exclusive Lock (X-lock) is incompatible with both shared and other exclusive locks because it is used for write operations and requires exclusive access to the resource.
Therefore:
- T1, T2, and T4 can all read the resource together using S-locks.
- T3 cannot obtain an X-lock while any S-lock exists on the resource.
Hence, option (a) is correct.
Important Key Points:
- Shared Locks (S-locks) allow multiple transactions to read the same resource simultaneously.
- Exclusive Locks (X-locks) are used for write operations.
- An X-lock is incompatible with both S-locks and other X-locks.
- Lock compatibility helps maintain data consistency and concurrency control in DBMS.
Knowledge Booster:
- (b) Transaction T3 can obtain an X-lock while T1 holds an S-lock: Incorrect because an X-lock is incompatible with an existing S-lock.
- (c) Transaction T4 can read the resource while T3 holds an X-lock: Incorrect because no shared access is allowed while an X-lock exists.
- (d) An S-lock and an X-lock are compatible on the same resource: Incorrect because S-locks and X-locks are incompatible.
- (e) Shared and exclusive locks are interchangeable: Incorrect because S-locks and X-locks serve different purposes and have different compatibility rules.