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.
|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 ;
What are the values of A and B after Schedule-2 ?
Here, the values of A and B initially are : 1000 and 2000.
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.