Theory Assignment 2-1
Theory Assignment 2-1
b. S2: r1(x)r2(x)r2(y)w2(y)r1(y)w1(x)
Let ri(z) and wi(z) denote read and write operations respectively on a data
item z by a transaction Ti. Consider the following two schedules.
6. Check whether the given schedule S is conflict serializable and recoverable or not.
T1 T2 T3 T4
READ(X)
WRITE(X)
COMMIT
WRITE(X)
COMMIT
WRITE(Y)
READ(Z)
COMMIT
READ(X)
READ(Y)
COMMIT
Schedule S
7. Consider a schedule of transaction T1 and T2:
T1 RA RC WD WB Commit
T2 RB WB RD WC Commit
Here, RX stands for “Read(X)” and WX stands for “Write(X)”. Which one of the
following schedules is conflict equivalent to the above schedule?
(A)
T1 RA RC WD WB Commit
T2 RB WB RD WC Commit
(B)
T1 RA RC WD WB Commit
T2 RB WB RD WC Commit
8. Consider the following two transactions:
T1: read(A);
read(B);
if A = 0 then B := B + 1;
write(B).
T2: read(B);
read(A);
if B = 0 then A := A + 1;
write(A).
Add lock and unlock instructions to transactions T1 and T2, so that they observe the two-
phase locking protocol. Can the execution of these transactions result in a deadlock?
9. Check whether the given schedule below can complete all its operations in the given
order using timestamp based protocol or not.
T1 T2
READ(A)
READ(A)
WRITE (A)
WRITE(A)
10. Write down Two major differences between immediate and deferred database
modification.
******************************End*****************************