5. T2: A := A+1
c) state whether the schedule is conflict serializable
d) Can the schedule arise if the transactions follow two-phase locking (without conversions)?
If so, show the points in the schedule at which lock-S, lock-X, and unlock are granted. (Insert the locking instructions without changing the relative order of any of the instructions that are shown. For lock acquisitions, put the instruction at the latest point when the can
be granted, while following all rules of 2PL and holding necessary locks to read/write data.)
If not, explain why not.
e) Is the schedule recoverable? If so, show where commit statements can be placed.
If not,
explain why it is not.
3. Repeat Problem 2 for the following schedule:
1. T3: read A
2. T3: A := A+1
3. T3: write A
4. T4: read A
5. T3: read B
6. T3: B := B-1
7. T4: A := A+1
8. T4: write A
9. T3: write B
10. T4: read B
11. T4: B := B-1
12. T4: write B
4. Consider T5, which executes the following instructions (in the given order):
read(A)
write(A)
read(B)
write(B)
and T6, which executes the following instructions (in the given order):
read(B)
write(B)
read(A)
write(A)
In both cases, assume some computations are done between the reads and writes that potentially change the values of A and B.
a) Show a schedule that obeys 2PL in which both transactions execute all their instructions. Include lock / unlock instructions
b) Show a schedule in which a deadlock occurs.