Transaction Concepts
if between steps 3 and 6, another transaction T2 is allowed to access the partially updated database, it will see an inconsistent database (the sum A + B will be less than it should be).
T1 |
T2 |
1. read(A)
|
|
2. A := A – 50 |
|
3. write(A) |
|
|
read(A), read(B), print(A+B) |
4. read(B) |
|
5. B := B + 50 |
|
6. write(B) |
|