/    /  DBMS – Transaction Isolation(2)

Transaction Isolation(2)

 

Take the example in the previous section and move on with this example for a better understanding.

Example-1: Create a Schedule-2 such that transaction T2 is followed by transaction T1.

 

T1T2
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

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

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

 

AB
Initial Values10002000
After T19002100
After T285502150

Here, the value of temp = 100.

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

Continue to the next part for further understanding.

Reference Link

Transaction Isolation(2)