37,764 views
100 100 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.

11 Answers

1 1 vote

Option A is correct (Bcz It is conservative 2PL)

Easy Explanation ; It is saying T acquire Exclusive lock (it can be shared also doesn't matter)

so if Lock Acquires at beginning 

then operation performed (Read/write)

then lock released (means Unlock)

So it is conservative 2PL ( guarantee serializability and  deadlock-freedom )

 

 

0 0 votes

The given protocol is a variant of two-phase locking (2PL) where a transaction acquires all exclusive locks in increasing order of object addresses, performs operations, and then releases all locks. This protocol guarantees both serializability and deadlock-freedom,--

Serializability


- Serializability ensures that the concurrent execution of transactions is equivalent to some serial execution.
- In this protocol, all locks are acquired before any operations are performed, and all locks are released only after all operations are completed. This adheres to the two-phase rule: a growing phase (acquiring locks) followed by a shrinking phase (releasing locks). Since no lock is released until all locks are acquired, the protocol ensures that the transaction has a consistent view of the data throughout its execution, which guarantees serializability. This is a fundamental property of 2PL.

Deadlock-Freedom


- Deadlock occurs when two or transactions are waiting for each other to release locks, resulting in a circular wait.
- In this protocol, locks are acquired in increasing order of object addresses. This imposes a total order on lock acquisition across all transactions. Since every transaction must acquire locks in the same order, circular wait cannot occur. For example, if transaction T1 locks object O1 (with a lower address) and transaction T2 requests O1, T2 must wait for T1 to release O1. T1 will eventually release all locks after completing its operations, allowing T2 to proceed. Thus, no deadlock is possible.

Answer :- A

0 0 votes
2pl Ensure conflict serializable and Deadlock free as they are in increasing order and only 1 Exclusive Lock
0 0 votes
Answer: A

Conflict Serializability:

Two-Phase Locking (2PL) is a standard concurrency control protocol that guarantees conflict serializability.

Since any transaction does not acquire locks AFTER releasing them it follows the 2PL protocol and therefore, it guarantees conflict serializability.

Freedom from Deadlock:

Since locks acquired on objects are exclusive and in strictly increasing order of their addresses, any transaction CANNOT hold and wait for a lock. Thus, the protocol is deadlock free.

 

Answer:
Position:
Show:

Related questions

32 32 votes
3 answers 3 answers
12.4k
12.4k views
Sandeep Singh asked Feb 12, 2016
12,444 views
Which one of the following is NOT a part of the ACID properties of database transactions?AtomicityConsistencyIsolationDeadlock-freedom
106 106 votes
8 answers 8 answers
30.3k
30.3k views
Sandeep Singh asked Feb 12, 2016
30,261 views
A database of research articles in a journal uses the following schema.$\text{(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, YEAR, PRICE)}$The primary key is '$\text{(VOLUME...
106 106 votes
12 answers 12 answers
37.5k
37.5k views
Akash Kanase asked Feb 12, 2016
37,468 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...
67 67 votes
6 answers 6 answers
28.6k
28.6k views
Sandeep Singh asked Feb 12, 2016
28,619 views
Consider the transition diagram of a PDA given below with input alphabet $\Sigma=\{a,b\}$ and stack alphabet $\Gamma = \{X,Z\}$. $Z$ is the initial stack symbol. Let $L$ ...