Se: r1(x); r2(z); r1(2); r3(x); r3(y); w1(x); c1; w3(y); a3; r2(y); w2(z); w2(y);c2 is recoverable or not

1 answer

The schedule is not recoverable.

Explanation:

In a schedule to be recoverable, if a transaction T1 reads a data item previously written by another transaction T2, then T2 must commit before T1 performs its write operation on that data item.

Looking at the schedule:

1. r1(x) - Transaction T1 reads the value of x.
2. r2(z) - Transaction T2 reads the value of z.
3. r1(2) - Transaction T1 reads the value 2.
4. r3(x) - Transaction T3 reads the value of x.
5. r3(y) - Transaction T3 reads the value of y.
6. w1(x) - Transaction T1 writes a new value to x.
7. c1 - Transaction T1 commits.
8. w3(y) - Transaction T3 writes a new value to y.
9. a3 - Transaction T3 aborts.
10. r2(y) - Transaction T2 reads the value of y.
11. w2(z) - Transaction T2 writes a new value to z.
12. w2(y) - Transaction T2 writes a new value to y.
13. c2 - Transaction T2 commits.

In step 10, transaction T2 reads the value of y which was last written by transaction T3 in step 8. Since transaction T3 aborts in step 9, it did not commit before transaction T2 read and wrote the value of y. Therefore, the schedule is not recoverable.