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.
T1 | 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 |
What are the values of A and B after Schedule-2 ?
Here, the values of A and B initially are : 1000 and 2000.
A | B | |
Initial Values | 1000 | 2000 |
After T1 | 900 | 2100 |
After T2 | 8550 | 2150 |
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