Consider the following two transactions : T1 and T2. Which of the following…

2007

Consider the following two transactions : T1 and T2.

image.png

Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?

image.pngimage.pngimage.pngimage.png

  1. A.

    A

  2. B.

    B

  3. C.

    C

  4. D.

    D

Attempted by 26 students.

Show answer & explanation

Correct answer: C


Answer is (C).

Many of you would point a DEADLOCK and I won't deny But see Question just asks for requirement to follow Strict 2PL. Requirement are

  1. Exclusive locks should be released after the commit.

  2. No Locking can be done after the first Unlock and vice versa.

In 2Pl deadlock may occur BUT it may be that it doesn't occur at all.

Consider that in option (C) if both execute in serial order without concurrency. Then that is perfectly valid and YES it follows Strict 2PL.

Explore the full course: Gate Guidance By Sanchit Sir