Skip to the content.

Transaction and locking minilab

(with explanations)

This is the page with explanations of the results. It may be more fun to use the page without explanations first, then look back here if you need to.

Demo 1 (lost update): simultaneously run

Demo 2 (uses transactions, but still results in a lost update): simultaneously run

Demo 3 (uses write locks and transactions, both complete successfully): simultaneously run

Demo 4 (uses read locks and transactions, so a deadlock occurs when the two transactions try to upgrade the read lock to a write lock; one transaction is rolled back and the other completes successfully): simultaneously run

Demo 5 (simpler demonstration of deadlock using only writes – transfer from one bank account to another): simultaneously run