Transactions questions

Q42

GATE CS 2017 CS-1TransactionsMCQ2 marks−2/3 if wrong
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?
Show answer without attempting

Answer: A

Q44

GATE CS 2017 CS-2TransactionsNAT2 marks
Two transactions T1T_1 and T2T_2 are given as

<br>T1:r1(X)w1(X)r1(Y)w1(Y)<br>T2:r2(Y)w2(Y)r2(Z)w2(Z)<br>\begin{aligned}<br>T_1 &: r_1(X)w_1(X)r_1(Y)w_1(Y) \\<br>T_2 &: r_2(Y)w_2(Y)r_2(Z)w_2(Z)<br>\end{aligned}

where ri(V)r_i(V) denotes a read operation by transaction TiT_i on a variable VV and wi(V)w_i(V) denotes a write operation by transaction TiT_i on a variable VV. The total number of conflict serializable schedules that can be formed by T1T_1 and T2T_2 is ____________.
Show answer without attempting

Answer: 54.0

0/20 correct0 marks

Related topics in Databases