edited by
792 views
0 votes
0 votes

Given problem and solution.
 

It is true that the given schedule is not serializable, what I don't understand is how it is not allowed by the 2PL protocol?

Given Schedule :

 

T1 T2 T3
  R(A)  
R(A)    
    R(B)
    W(B)
  W(A)  
R(A)    

 

Under 2PL :

 

T1 T3 T3
  S(A)  
  R(A)  
S(A)    
R(A)    
    S(B)
    R(B)
    X(B)
    W(B)
    Lock Point
    U(B)
  X(A)  
  W(A)  
  Lock Point  
  U(A)  
S(A)    
Lock Point    
U(A)    

 

edited by

1 Answer

Best answer
2 votes
2 votes
This schedule is not in 2PL since X(A) in T2 can’t be acquired before releasing all the shared lock, If you release shared lock on A in T1 (before exclusive lock of T2) then you can’t acquire in final Read Request of T1. So this is not in 2PL.

Other explanation can be:

A 2PL schedule => conflict serializable

But the above schedule is not even conflict serializable (You can check it by swapping non conflicting pair, You will run into the issue with W2(A).)

So by contraposition (Not conflict schedule => not 2PL).

Hence the above schedule is neither 2PL nor conflict Serializable.

Regarding View Serializability: T1,T3 should come before T2 (Initial Read). But according to W R sequence of T1 and T2(Final 2 operations) T2 should come before T1 leading to contradiction. Hence Not View Serializable.

 

Hence the answer is D i.e. Schedule is not Serializable.
selected by

Related questions

2 votes
2 votes
0 answers
2
vinay chauhan asked Jan 18, 2019
606 views
Is different 2 phase locking a subset of each other? For example, if the schedule is Strict 2PL then it will also be simple 2PL.Something like a 2PL is a subset of Strict...
1 votes
1 votes
1 answer
3
aditi19 asked Nov 25, 2018
457 views
T1: W(X), T2: R(Y), T1: R(Y), T2: R(X)does 2PL protocol allows it? T1 T2L-X(X)W(X)L-S(Y)R(Y)U(X) L-S(Y)R(Y)L-S(X)R(X)here T2 is granted lock on X as T1 enters sh...
0 votes
0 votes
3 answers
4
Gurdeep Saini asked Nov 6, 2018
3,724 views
is conservative 2PL is recoverable schedule ?