edited by
22,716 views
81 81 votes

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

7 Answers

80 80 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)

27 27 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.

7 7 votes
As shown:   T1------>T2            and  T2-------->T1

hence there is a cycle so it is not Conflict Serializable.

For 2PL:  as according to 2PL in the Growing phase we can acquire locks on data items only and in the Shrinking phase we can do unlocking only. Therefore if we do the same as above then in transaction T1 there will be the exclusive lock on data variable A (it can not be unlocked as there is remaining transaction T1) and at the same time if we look at T2, in the T2 transaction it is trying to get a lock on variable A which is not possible.

That’s why it can not occur in the 2PL protocol.

Hence answer is D
2 2 votes

First and important thing to notice here serialiable means question asking for general serializibilty but due to NO computation between R/W so general Serializibility is equivalent to View Serializibility 

credit @Deepakpoonia sir @GOClasses

edited by
0 0 votes

There is a cycle between T1 and T2. So, the schedule is not view-serializable.

If the schedule is not serializable, then it is also not 2PL.

Note : If a schedule is serializable, then it does not guarantee 2PL (same as Pumping Lemma analogy) 

Answer:
Position:
Show:

Related questions

43 43 votes
6 answers 6 answers
16.6k
16.6k views
Kathleen asked Sep 23, 2014
16,618 views
The number of binary strings of $n$ zeros and $k$ ones in which no two ones are adjacent is$^{n-1}C_k$$^nC_k$$^nC_{k+1}$None of the above
100 100 votes
14 answers 14 answers
47.3k
47.3k views
Kathleen asked Sep 23, 2014
47,317 views
Consider the schema $R=(S,T, U, V)$ and the dependencies $S \rightarrow T, T \rightarrow U, U \rightarrow V$ and $V \rightarrow S$. Let $R = (R1\text{ and } R2)$ be a dec...
49 49 votes
2 answers 2 answers
12.9k
12.9k views
Kathleen asked Sep 23, 2014
12,861 views
Consider a B-tree with degree $m$, that is, the number of children, $c$, of any internal node (except the root) is such that $m \leq c \leq 2m-1$. Derive the maximum and ...
49 49 votes
4 answers 4 answers
22.3k
22.3k views
Kathleen asked Sep 23, 2014
22,291 views
Which of the following is correct?B-trees are for storing data on disk and B$^+$ trees are for main memory.Range queries are faster on B$^+$ trees.B-trees are for primary...