| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Trouble understanding serializability
This is a question out of Database System Concepts by Silberchatz.
Consider the following two transactions, T1 and T2
T1: read(A)
read(B)
if A=1 then B:=B-1
write(B)
T2: read(B)
read(A)
if B=1 then A:=A-1
write(A)
Initial values are A=B=1 and the consistency condition is (A=1) OR (B=1)
The question: is there a concurrent execution of T1 and T2 that produces a serializable schedule? Prove your answer.
Now to me this is confusing ... you'd only have to ensure the T1 reads(A) before T2 writes(A) or T2 reads(B) before T2 writes(B). No other operations seem to conflict. What's the answer to this?
Cheers,
David Received on Sun Jun 13 2004 - 07:42:58 CDT
![]() |
![]() |