Database Systems
Committing your transactions…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Database Systems
Committing your transactions…
Acquire every lock you need, then release them — never the other way round. That one rule makes every schedule serializable, and leaves deadlocks and cascading aborts to deal with.
Click Play to begin.
| held \ asked | S | X |
|---|---|---|
| S | ||
| X |
Basic 2PL guarantees conflict-serializability but can expose uncommitted writes, so one abort can cascade.
Strict 2PL keeps exclusive locks until commit: no cascading aborts, recoverable schedules. Most systems go further and hold every lock to the end (rigorous 2PL).
Neither prevents deadlock — the database detects cycles in the waits-for graph and aborts a victim.
Question 1 of 3
What does the "two phases" of two-phase locking refer to?