+24 votes
3.4k 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

edited | 3.4k views
0
quating from namathe " 2pl guarantees serializability but it does not permit all serializable schedule"
+2
stmt - we must know that if schedule is 2pl(P) then it is serialzable(Q) too

So,P->Q which is equivalent to its contrapositive parts i.e ~Q->~P

which states that if not serializable then not 2pl.

In Schedule given we can easily prove that it is not serializable and hence not occur in 2pl.

## 3 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)

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
0 votes As we can see the precedence graph is creating a cycle. $\implies$ It is not a conflict serializable schedule

Also there is no blind write in the given schedule $\implies$ It is not view serializable (As it is not a conflict serializable schedule. ) $\implies$ It is not serilizable schedule.

Also if a schedule is not serializable then it cannot be 2PL $\implies$ It is not 2PL schedule.

$\therefore$ Option $D.$ is correct answer.

by Boss (17.2k points)
–1 vote
Option D
by (419 points)
Answer:

+20 votes
2 answers
2
+21 votes
2 answers
3
+16 votes
1 answer
4
+16 votes
3 answers
5
+32 votes
1 answer
6
+24 votes
1 answer
7