Schedule 1 Let T transfer $50 from A to B,and T2 transfer 10%of the balance from A to B. A serial schedule in which T is followed by T2: T T2 read (A) A=A-50 write (A) read(B) B=B+50 write(B) commit read(A) temp :=A*0.1 A:=A-temp write (A) read(B) B:=B+temp write(B) commit Database System Concepts-7th Edition 17.12 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 17.12 ©Silberschatz, Korth and Sudarshan th Edition Schedule 1 ▪ Let T1 transfer $50 from A to B, and T2 transfer 10% of the balance from A to B. ▪ A serial schedule in which T1 is followed by T2 :
Schedule 2 A serial schedule where T2 is followed by T1 T T2 read(A) temp :=A*0.1 A:=A-temp write (A) read (B) B:=B+temp write(B) commit read(A) A:=A-50 write (A) read(B) B:=B+50 write(B) commit Database System Concepts-7th Edition 17.13 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 17.13 ©Silberschatz, Korth and Sudarshan th Edition Schedule 2 ▪ A serial schedule where T2 is followed by T1
Schedule 3 Let T1 and T2 be the transactions defined previously.The following schedule is not a serial schedule,but it is eguivalent to Schedule 1 T T2 read (A) A=A-50 write(A) read (A) temp :=A*0.1 A:=A-temp write(A) read(B) B=B+50 write(B) commit read(B) B:=B+temp write(B) commit In Schedules 1,2 and 3,the sum A+B is preserved. Database System Concepts-7th Edition 17.14 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 17.14 ©Silberschatz, Korth and Sudarshan th Edition Schedule 3 ▪ Let T1 and T2 be the transactions defined previously. The following schedule is not a serial schedule, but it is equivalent to Schedule 1 ▪ In Schedules 1, 2 and 3, the sum A + B is preserved