Ask Question
2 July, 06:04

1. Consider a database with object X and Y and assume that there are two transactions T1 and T2. Transaction T1 reads objects X and Y and then writes object X. Transaction T2 reads objects X and Y and writes objects X and Y. (a) Give an example schedule with actions of transaction T1 and T2 on objects X and Y that results in a write-read conflict. (b) Give an example schedule with actions of transaction T1 and T2 on objects X and Y that results in a read-write conflict. (c) Give an example schedule with actions of transaction T1 and T2 on objects X and Y that results in a write-write conflict. (d) For each of the schedules, show that strict 2PL disallows the schedule.

+3
Answers (1)
  1. 2 July, 07:36
    0
    See explaination

    Explanation:

    1. The following schedule results in a write-read conflict:

    T2:R (X), T2:R (Y), T2:W (X), T1:R (X) ...

    T1:R (X) is a dirty read here.

    2. The following schedule results in a read-write conflict:

    T2:R (X), T2:R (Y), T1:R (X), T1:R (Y), T1:W (X) ...

    Now, T2 will get an unrepeatable read on X.

    3. The following schedule results in a write-write conflict:

    T2:R (X), T2:R (Y), T1:R (X), T1:R (Y), T1:W (X), T2:W (X) ...

    Now, T2 has overwritten uncommitted data.

    Below history will show that T1 and T2 preserves the consistency requirement of the database

    T1 T2:R1X, R1Y, W1X, c1, R2X, R2Y, W2X, W2Y, c2

    T2 T1:R2X, R2Y, W2X, W2Y, c2, R1X, R1Y, W1X, c1

    b)

    To eliminate both undo and redo, all of T's updates must be recorded in the stable database in a single atomic operation when T commits

    We can implement this strategy using Shadowing and Stable database techniques.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “1. Consider a database with object X and Y and assume that there are two transactions T1 and T2. Transaction T1 reads objects X and Y and ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers