/    /  DBMS – Transaction Isolation(3)

Transaction Isolation(3)

Refer to the previous parts for the initial example

Example-1: Create a Schedule-3 such that it is : < T11,  T21,  T12,  T22 >

Where, T11 :  first 3 statements of T1. 

   T12 :  last 4 statements of T1.

   T21 :  first 4 statements of T2.

   T22 :  last 4 statements of T2.

 

T1T2
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

What are the values of A and B after Schedule-3 ?

Here, the values of A and B initially are : 1000 and 2000.

 

T1T2
ABAB
Initial Values1000200010002000
After T119502000—–—–
After T21—–—–9002000
After T129502050—–—–
After T22—–—–9002100

Here, the value of temp = 100.

Also, before and after Schedule-1, A + B values are the same.

 

Reference Links

Transaction Isolation(3)