in Databases edited by
1,655 views
3 votes
3 votes
Consider the following schedules involving two transactions.

$S_1 : R_1(x), W_2(y),R_2(x),W_1(y), \ commit_1, \ commit_2$

$S_2 : R_1(x), R_2(y),W_1(z), \ commit_1,R_3(y), R_3(z), W_2(y), W_3(x), commit_2, commit_3$

Which of the following statements is true?

A) Both S1 and S2 are allowed under 2PL
B) only S1 is allowed under 2PL
C) only S2 is allowed under 2PL
D)  neither S1 nor S2 is allowed under 2PL
in Databases edited by
1.7k views

4 Comments

whats ur reason ?
0
0
once we start unlocking  we are not going to lock any variable again
0
0
but where are we doing this ? did u saw minipandas comment ?
0
0

4 Answers

2 votes
2 votes

Concluding the above comments:

S1 is 2PL which can be seen easily in Fig.1.

Fig.1

 

 

The main problem is in the step that I have marked in the Fig.2 for schedule S2, which is that whether we can apply lock on X where it is applied in transaction 3. According to me, I have seen no such restriction, therefore S2 should be 2PL. If anyone knows anything about this, please do share in the comments.

Fig.2

 

0 votes
0 votes
D is the correct answer ??
edited by
by

3 Comments

No answer is given.Please explain.
0
0
First of all tell me that option D is Right or wrong ??
then I will  explain you
I am also don,t know the correct answer that's Y im asking you
0
0
i closed the question.... just read the discussion
0
0
0 votes
0 votes
D will be the answer because S2 will obtain all the locks in the growing phase and S1 can't do anything till S2 releases locks but we can see an overlap so both are not allowed for 2 phase locking protocol.
by
0 votes
0 votes

S1: It satisfies 2PL

T1 T2
SL(X) SL(X)
R(X) XL(Y)
   
  W(Y)
  U(Y)
XL(Y) R(X)
  U(X)
W(Y)  
U(X)  
U(Y)