GATE / CS ARCHIVE

GATE CSE 2016 SET 1 / QUESTION 51

GATE CSE 2016 Set 1 Q51

Database Management Systems · Transactions & Concurrency Control · Full GATE CSE 2016 Set 1 paper

GATE 2016 Set 1, Q51 2 marks · MCQ
Report issue

Transactions & Concurrency Control

Question 51, GATE 2016: A transaction accessing objects O1,...,Ok first obtains exclusive locks on all of them in increasing memory-address order, then performs its operations, then releases all locks. The same protocol is followed by every transaction. What is guaranteed? A:serializability and deadlock-freedom. B:neither. C:serializability only. D:deadlock-freedom only.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Acquiring all exclusive locks before releasing any is two-phase locking, ensuring conflict serializability. Every transaction acquires locks in the same increasing object-address order. A circular wait would force a strict sequence of increasing addresses to return to its starting address, impossible. The protocol is therefore also deadlock-free, A.

The growing phase contains every lock acquisition, and the shrinking phase contains only releases, so this is stronger than ordinary two-phase locking and ensures conflict serializability. The common global address order prevents cycles in the wait-for graph: following a chain of waits requires strictly increasing lock addresses. Serializability alone would not prevent deadlock in arbitrary two-phase locking, so both parts of the argument are needed. Locking exclusively for reads is conservative but does not invalidate either guarantee.

Original paper, page 19 · Answer key