Activate STM example scenario
- 1. Two concurrent bank transactions.
If there is inconsistency, money can appear or money can disappear.
- 3. Transaction 1 (T1) reads the Account1 balance and takes a snapshot.
The snapshot is now in the transaction scope.
- 13. T1 ends first and can commit the Account 1 balance new value.
- 15. The STM detects that T2 has reads and writes conflicts with the T1 already commited
values.
- 16. Assuming that T2 does not have side effects, it can be executed again (retried).
- 24. The two transactions end with success. Reads and writes were isolated and the STM
detected the conflict, resolving it with the T2 retry.