Part 1 of 5 · 1 min read
Why this page comes first
In this module you will
- Describe how a deadlock forms between two transactions holding locks.
- Explain deadlock detection using a wait-for graph.
- Explain deadlock prevention, as distinct from detection.
- Describe what the database does once a deadlock is found.
Two pages ago, locking was introduced as a mechanism that makes a conflicting transaction wait rather than reject it outright. That waiting, it turns out, can itself go wrong: two transactions can end up waiting on each other forever. This page covers that specific failure and how databases handle it.