CS FundamentalsModerateGATE CS (PYQ pattern)
Under strict 2PL, T1 and T2 both hold S(A) and each now requests X(A) (a lock upgrade). T3 holds S(B) and requests X(A). T4 holds X(C) and requests S(B). Which transactions are deadlocked?
- A. T1, T2 and T3
- B. None, because shared locks never conflict
- C. T3 and T4
- D. T1 and T2 only
Correct answer: D. T1 and T2 only
T1's upgrade waits for T2's S(A) and vice versa: a 2-cycle. T3 waits for T1 and T2 but nothing waits on T3 in a cycle, so T3 is blocked behind the deadlock, not part of it. T4's S(B) is compatible with T3's S(B) and is granted.
More DBMS and SQL questions
- An ER diagram has a supertype PERSON(pid, name) with disjoint, total specialisation into STUDENT(gpa) and TEACHER(salary). Using the 'one…
- Relations R(A, B, C) with key A and S(C, D) with key C, where R.C is a foreign key to S. A row of S that is referenced by some R rows is…
- PA(id, k): (1,1), (2,2), (3,2), (4,3), (5,NULL), (6,4). PB(k, z): (1,9), (2,9), (2,8), (NULL,7). Let p = rows of SELECT FROM PA LEFT JOIN…
- GB(id, v): (1,5), (2,12), (3,18), (4,25), (5,31), (6,39), (7,NULL). The query SELECT v / 10, COUNT() FROM GB GROUP BY v / 10 uses integer…
- Three transactions each execute R(A) followed by W(A) on the same item A. Among all interleavings of the six operations (each…
- T1: R(A), W(A), R(B) and T2: R(B), W(B), R(A), each in that order. Of the C(6,3) = 20 interleavings, how many are conflict-serializable?