The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+2 votes


  Which of the following transaction(s) follow 2-phase locking protocol?
  1. lock1(a)read1(a)lock2(b)write2(b)lock1(c)unlock2(b)unclock1(c)lock2(c)unlock1(a)
  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

asked in Databases by Junior (581 points) | 68 views
2. only 2??
what is problem with 2, I think it is 2PL.

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


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.


@joshi_nitish ya correct, i didn't notice it... 2 is allowed under 2PL
finally b is the answer.

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

33,712 questions
40,255 answers
38,883 users