Ask 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 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. 22 July, 12:24
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers