Please explain your answer


Consider the following two phase locking protocol. Suppose a transaction TT accesses (for read or write operations), a certain set of objects {O1,…Ok}{O1,…Ok}. This is done in the following manner:

Step 1Step 1 . TT acquires exclusive locks to O1,…,OkO1,…,Ok in increasing order of their addresses.

Step 2Step 2 . The required operations are performed .

Step 3Step 3 . All locks are released

This protocol will

a. guarantee serializability and deadlock-freedom
b. guarantee neither serializability nor deadlock-freedom
c. guarantee serializability but not deadlock-freedom
d. guarantee deadlock-freedom but not serializability.


Answer: (A)

The scenario is Conservative 2PL( or Static 2PL). In Conservative 2PL protocol, a transaction has to lock all the items it access before the transaction begins execution. It is used to avoid deadlocks. Also, 2PL is conflict serializable, therefore it guarantees serializability.

so the answer is option A