Last Updated: April 13, 2026
When two transactions each hold a lock the other needs, neither can proceed. Both sit there waiting forever, unless the database steps in and kills one. This situation is called a deadlock, and understanding how it forms, how databases detect it, and how to prevent it is essential for writing correct concurrent code.