The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+24 votes
3.3k views

For the schedule given below, which of the following is correct:

$$\begin{array}{ll} \text{1} & \text{Read A} & \text{} \\  \text{2} & \text{} & \text{Read B} \\   \text{3} & \text{Write A} & \text{} \\  \text{4} & \text{} & \text{Read A} \\ \text{5} & \text{} & \text{Write A} \\ \text{6} & \text{} & \text{Write B} \\ \text{7} & \text{Read B} & \text{} \\ \text{8} & \text{Write B} & \text{} \\\end{array}$$

  1. This schedule is serializable and can occur in a scheme using 2PL protocol

  2. This schedule is serializable but cannot occur in a scheme using 2PL protocol

  3. This schedule is not serializable but can occur in a scheme using 2PL protocol

  4. This schedule is not serializable and cannot occur in a scheme using 2PL protocol

asked in Databases by Veteran (52k points)
edited by | 3.3k views
0
quating from namathe " 2pl guarantees serializability but it does not permit all serializable schedule"

2 Answers

+21 votes

If we draw the precedence graph we get a loop,and hence the schedule is not conflict serializable.

There is no blind write too so ,there is no chance that view serializability can occur.

Now 2pl ensures CS.

Since possiblity of CS is ruled out at the onset,so schedule cannot occur in 2PL.

Ans d)

answered by Active (3.6k points)
0
What it means that it cannot occour in a scheme using 2PL protocol?? Plzzz explain.
0
If a schedule occur in 2PL protocol does it mean that...both the transaction should be completed.?

Because here only first transaction can be completed..second will be blocked at READ A.....
0
If a schedule occurs in 2PL successfully, it is conflict serializable I think.
0
For a schedule to be in 2PL, there should be growth and shrinking phase. Cann't I use this fact to say it is not possible using 2PL.?
0
growth and shrinking phase of ""             ""?
0
locks..
0
where are locks here?
0
That's what i want to say that there is no locks. So can i say directly it is not using 2-phase locking.
+3

if there is a lock then only we can talk about that concept else have to go with other methods to check...

+2

@thor 
we have to put locks ourselves and then check if 2PL is possible or not.
 

0
Suppose if I get some new question regarding if schedule is 2PL or not? then do i have to put locks myself or analyse schedule on the basis of already present lock?
0
@thor see my updated solution
–1 vote
Option D
answered by (419 points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,541 questions
54,094 answers
187,240 comments
71,002 users