






















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























































Example of Fund Transfer (^) Transaction to transfer $50 from account A to account B :
(^) Active, the initial state; the transaction stays in this state while it is executing (^) Partially committed, after the final statement has been executed. (^) Failed, after the discovery that normal execution can no longer proceed. (^) Aborted, after the transaction has been rolled back and the database restored to its state prior to the start of the transaction. Two options after it has been aborted: (^) restart the transaction – only if no internal logical error (^) kill the transaction (^) Committed, after successful completion.
(^) Schedules – sequences that indicate the chronological order in which instructions of concurrent transactions are executed
Scheduling Transactions
(^) Let T 1 and^ T 2 be the transactions defined previously_._^ The following schedule (Schedule 2 in the text) is not a serial schedule, but it is equivalent to Schedule 1. In both Schedule 1 and 2, the sum A + B is preserved. T1 T Read(a) A := A – 50 Write(A) Read(B) B:= B+ Write(B) Commit Read(A) A:= A – A*0. Write(A) Read(B) B := B +B 0. Write(B) Commit T1 T Read(a) A := A – 50 Write(A) Read(B) B:= B+ Write(B) Commit Read(A) A:= A – A0. Write(A) Read(B) B := B +B *0. Write(B) Commit
(^) The following concurrent schedule (Schedule 3 in the text) does not preserve the value of the the sum A + B. T1 T Read(a) A := A – 50 Write(A) Read(B) B:= B+ Write(B) Commit Read(A) A:= A – A*0. Write(A) Read(B) B := B +B 0. Write(B) Commit T1 T Read(a) A := A – 50 Write(A) Read(B) B:= B+ Write(B) Commit Read(A) A:= A – A0. Write(A) Read(B) B := B +B *0. Write(B) Commit
Conflict Serializability (^) Instructions l i and^ lj of transactions^ Ti and^ Tj respectively, conflict if and only if there exists some item Q accessed by both li and lj , and at least one of these instructions wrote Q.
Conflict Serializability(cont’d)
T1 T Read(a) A := A – 50 Write(A) Read(B) B:= B+ Write(B) Commit Read(A) A:= A – A*0. Write(A) Read(B) B := B – B 0. Write(B) Commit T1 T Read(a) A := A – 50 Write(A) Read(B) B:= B+ Write(B) Commit Read(A) A:= A – A0. Write(A) Read(B) B := B – B *0. Write(B) Commit