Skip to content
Official PYQ · 1999

GATE CS 1999 Q2.6 — Transactions and Concurrency Control

Explain with AI

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

1Read A2Read B3Write A4Read A5Write A6Write B7Read B8Write B\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}

Choose one option
View worked solution

Answer: D

To determine the properties of the given schedule, let us analyze the conflicts between transactions T1T_1 (left column) and T2T_2 (right column):

  1. Conflict on AA: T1T_1 writes AA at step 3, and T2T_2 reads AA at step 4. This creates a conflict dependency: T1→T2T_1 \to T_2.
  2. Conflict on BB: T2T_2 writes BB at step 6, and T1T_1 reads BB at step 7. This creates a conflict dependency: T2→T1T_2 \to T_1.

The precedence graph contains a cycle: T1→T2→T1T_1 \to T_2 \to T_1. Because of this cycle, the schedule is not conflict serializable. Since there are only two transactions, conflict serializability is equivalent to view serializability, meaning the schedule is not serializable.

Furthermore, any schedule allowed by the Two-Phase Locking (2PL) protocol is guaranteed to be conflict serializable. Since this schedule is not conflict serializable, it cannot occur under any 2PL scheme.

Thus, the schedule is not serializable and cannot occur in a scheme using 2PL protocol.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions