MCQ · 2 marks · Transactions

GATE CS 2017 CS-1 — Q42

In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let TS(T1)TS(T_1) and TS(T2)TS(T_2) be the timestamps of transactions T1T_1 and T2T_2 respectively. Besides, T1T_1 holds a lock on the resource R, and T2T_2 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 TS(T2)<TS(T1) thenT1 is killedelse T2 waits.\begin{aligned} & \text{if } TS(T_2) < TS(T_1) \text{ then} \\ & \quad T_1 \text{ is killed} \\ & \text{else } T_2 \text{ waits.} \end{aligned}

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?
Select one option