21,273 views
64 votes
64 votes

Consider the following two phase locking protocol. Suppose a transaction $T$ accesses (for read or write operations), a certain set of objects $\{O_1,\ldots,O_k \}$. This is done in the following manner:

  • $\text{Step 1}$. $T$ acquires exclusive locks to $O_1,\ldots,O_k$ in increasing order of their addresses.
  • $\text{Step 2}$. The required operations are performed .
  • $\text{Step 3}$. All locks are released

This protocol will

  1.  guarantee serializability and  deadlock-freedom 
  2.  guarantee neither serializability nor deadlock-freedom 
  3.  guarantee serializability but not deadlock-freedom  
  4.  guarantee deadlock-freedom but not serializability.

4 Answers

Best answer
102 votes
102 votes

Two Phase Locking protocol is conflict serializable. So this is a modified version of the basic $2PL$ protocol, So serializabilty should be guaranteed.. and we can get a serializable scheduling by ordering based on Lock points(same as in basic $2PL$
)..
Now in Step $1,$ exclusive locks are aquired to $O_1,O_2,O_3$.... in increasing order of addresses..since it is mentioned as exclusive lock, only one transaction can lock the object..
Due to acquiring of locks based on ordering of addresses.. and locks aren't released until the transaction completes its operation.. we can prevent the circular wait condition, and hence making it deadlock free.

So, the answer should be (A) guarantees serializability and deadlock freedom

edited by
12 votes
12 votes
It is Conservative 2PL Protocol which ensures Deadlock Freedom. Therefore A is the correct answer.
6 votes
6 votes
A is correct option .....
1 votes
1 votes
EVEN THOUGH THERE IS MORE THAN ONE LOCKS EITHER EXCLUSIVE OR ANY GROWING LOCKS AND RELESING LOCKS DOES NOT OCCUR  DEADLOCK  SO OPTION A IS CORRECT
Answer:

Related questions

23 votes
23 votes
2 answers
1
Sandeep Singh asked Feb 12, 2016
10,008 views
Which one of the following is NOT a part of the ACID properties of database transactions?AtomicityConsistencyIsolationDeadlock-freedom
64 votes
64 votes
6 answers
3
Akash Kanase asked Feb 12, 2016
21,838 views
Consider the following database schedule with two transactions $T_{1}$ and $T_{2}$.$S= r_{2}\left(X\right); r_{1}\left(X\right); r_{2} \left(Y\right); w_{1} \left(X\right...
30 votes
30 votes
2 answers
4
Sandeep Singh asked Feb 12, 2016
7,067 views
Which of the following is NOT a superkey in a relational schema with attributes $V,W,X,Y,Z$ and primary key $V\;Y$?$VXYZ$$VWXZ$$VWXY$$VWXYZ$