GATE CSE 2017 Session 1 Q52: Deadlock prevention: if TS(T2) < TS(T1) kill T1 else T2 waits
- Databases
- 2 marks
- MCQ
- −2/3 if wrong
Syllabus topic: Transactions and concurrency control
Question
In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let and be the timestamps of transactions and respectively. Besides, holds a lock on the resource R, and has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.
if then
is killed
else waits.
Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: A (official GATE 2017 final answer key)
Concept used: This is the wound-wait scheme: an older requester wounds (kills) a younger holder, a younger requester waits; waits only go from younger to older, so no cycle, and a restarted transaction keeps its timestamp so it eventually becomes oldest.
First step: Note which direction waiting is allowed (younger waits for older only) and ask whether a wait-for cycle can form; then ask what happens to a repeatedly killed transaction that keeps its old timestamp.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Transactions and concurrency control
Every PYQ on this topic →Share this question
Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Databases PYQs
- 2026 Session 1 · Q30Which functional dependency inferences always hold
- 2026 Session 1 · Q31Dependency-preserving decompositions for 1NF, 2NF, 3NF, BCNF
- 2026 Session 1 · Q43Relational algebra equivalent of a tuple calculus join query
- 2026 Session 1 · Q65Number of superkeys with candidate keys {A,B} and {A,C}
- 2026 Session 2 · Q15Match DBMS schema levels with what they describe
- 2026 Session 2 · Q20When two transactions do not conflict on a data item