32.7. Deadlock and Livelocks
It is possible for a user to fail to complete a transaction for reasons other than the hardware failing. A deadlock is a situation where two or more users hold resources that the others need and neither party will surrender the objects to which they have locks. To make this more concrete, imagine that both user A and user B need tables X and Y. User A gets a lock on table X, and User B gets a lock on table Y. They both sit and wait for their missing resource to become available; it never happens. The common solution for a deadlock is for the DBA to kill one or more of the sessions involved and rollback their work.
In a livelock, a user is waiting for a resource, but never gets it because other users keep grabbing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access