Transactions: A tomicity C onsistency I solation D urability Concurrency Control: ------------------------- Transaction: T1: r1(x) w1(x) T2: r2(x) w2(x) Concurrent operations: Schedule: S0: r1(x) r2(x) w1(x) w2(x) S1: r1(x) w1(x) r2(x) w2(x) S2: r2(x) w2(x) r1(x) w1(x) What is a good schedule? -------------------------- A serial schedule (where one transaction executes at a time) is a good schedule: if I execute one transaction at a time, the resulting database state is always correct. A serializable schedule is one that is guaranteed to provide the same results as a serial schedule. Conflicting operations ------------------------ Two operations conflict with each other, if they are by two different transactions and one of them is a write operation r1(x) w2(x) w1(x) r2(x) w1(x) w2(x) If in two schedules, the conflicting operations occur in the same order, then their result is guaranteed to be the same: then these two schedules are equivalent S0: r1(x) [ r2(x) w1(x) ] w2(x) --> r2(x) reads values before it is changed S0': r1(x) [ w1(x) r2(x)] w2(x) --> r2(x) read the value after T1 writes S0 and S0' are not guaranteed to produce the same result A schedule S is serializable (equal to a serial schedule) iff all conflicting operations in S occur in the same order as a serial schedule. ----------