Discussion
Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?
| Transaction T1 | Transaction T2 |
|---|---|
| R1(X) W1(Y) R1(X) W1(X) COMMIT(T1) | W2(X) W2(Y) COMMIT(T2) |
Answer: B
The conflict serializable schedule is W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1).
Draw the precedence graph: for each pair of conflicting operations (same item, different transactions, at least one a write), add an edge from the transaction that acts first. The schedule is conflict serializable exactly when the graph has no cycle.
- This schedule: W2(X) before R1(X) and before W1(X), and W2(Y) before W1(Y). Every edge is T2 → T1, so it is equivalent to the serial order T2, T1.
- R1(X), W2(X), ... , R1(X): R1(X) before W2(X) gives T1 → T2, and W2(X) before the second R1(X) gives T2 → T1: a cycle.
- R1(X), W1(Y), W2(X), W2(Y), R1(X), ...: T1 → T2 on X and on Y, but W2(X) before the second R1(X) gives T2 → T1: a cycle.
- W2(X), R1(X), W1(Y), W2(Y), ...: T2 → T1 on X but W1(Y) before W2(Y) gives T1 → T2: a cycle.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development