in Databases retagged by
837 views
0 votes
0 votes

Account on the following statements
 

  1. IF Conflict Serial schedule then it is ALWAYS possible under 2PL
in Databases retagged by
by
837 views

4 Comments

edited by
If the precedence graph contain no cycle than .the schedule is css and also .it is always possible under 2pl ! 2pl here means .there will no denied of lock requests necessary locks will be applies succesfully to the schedule .
0
0

whats the answr then..?is it possible always or not?

i dun think that it is always possible

consider this schedule for example:

image:Database Subject Test - 2/Q14_exp5.PNG

image:Database Subject Test - 2/Q14_exp6.PNG

here,T1 wont get XL(c)_ because T2 has already put S(C) and it wont release that lock before W(D) is performed.

so order is not retained as locks will be released only in phase 2.

0
0

correct will be

if 2PL then must be CSS

or

if not CSS then not 2PL

0
0

1 Answer

–1 vote
–1 vote
@AKhilNadh. Sorry for the previous incorrect answers.

Look at this conflict serializable schedule.

T1                       T2

------------------------------------

Shared(A)

R(A)

unlock(A)

                     exclusive(A)

                       W(A)

                    unlock(A)

------------------------------------>    At this point,T1 cannot acquire lock on B under 2PL.

W(B)

 

So, answer is every conflict serializable schedule is not always possible under 2PL.

3 Comments

@Sushant_Gokhale

T2 is not using data item B so T1 can peacefully update 'B'
Read the comment by@cse23 It is the perfect answer.
If conflict serialisable then it is view serialisable Every serial schedule will always be in 2PL . 2PL is used to implement serialisablity among the schedules
0
0
@Akhil. What do you want to prove?

First, there is diff betn serial and serializable schedule.

Second, you are saying that 2PL is used to implement serializability. But, question asks you prove vice-verssa.

Third, I know that every conflict serializable is also view serializable, but every conflict serializable is not possible under 2PL. I have already given an example.
0
0
I don't think so

I mean if any schedule follows 2PL then it ensures seriazibility but if a schedule is conflict serializable it may or may not ensure 2-phase locking..

there can be chances that order of conflict operations are same in the transaction(no cycle) but Lock point(point at which any transaction acquire the last lock) order is not ensuring serializability(may result in cycle  in precedence graph)
2
2