86 views
  Which of the following transaction(s) follow 2-phase locking protocol?

2. lock1(a)lock1(b)unlock1(a)lock2(a)write2(a)unlock2(a)unlock1(b)
3. lock1(a)lock2(b)lock1(c)lock3(d)unlock2(b)lock3(b)unlock1(a)unlock3(d)unlock1(c)lock3(c)

1. Only 1

2. Only 2

3. Only 1 and 3

4. None of them

| 86 views
0
2. only 2??
0
what is problem with 2, I think it is 2PL.
0

In 2, we are doing like
Lock, Lock, Unlock, Lock
we can't do unlocking in between ..

0

@stblue

in 2, there is no "Lock, Lock, Unlock, Lock"

lock1 and unlock2 are on two different transactions T1 and T2..

only 2 is allowed under 2PL.

0
@joshi_nitish ya correct, i didn't notice it... 2 is allowed under 2PL
0