CS FundamentalsHardGATE CS (PYQ pattern)

Multiple-granularity locking (modes IS, IX, S, SIX, X with the standard compatibility matrix). T1 holds IX on table TB and S on row r1 of TB. Each of the following transactions, judged separately against this state only, asks for its locks: T2 wants SIX on TB; T3 wants IX on TB and then X on row r2; T4 wants S on TB; T5 wants IS on TB and then S on r1. Which of T2..T5 get all their locks immediately?

  1. A. T2, T3 and T5
  2. B. T3 only
  3. C. T3, T4 and T5
  4. D. T3 and T5 only

Correct answer: D. T3 and T5 only

IX is compatible with IX and IS but not with S or SIX, so T2 (SIX) and T4 (S) must wait. T3: IX on TB is fine and r2 is unlocked, so X on r2 is granted. T5: IS on TB is fine and S on r1 is compatible with T1's S. Hence T3 and T5.

More DBMS and SQL questions

Exams that ask this topic