Database · Medium
What is a deadlock? How do databases detect it and how do you prevent it?
DatabaseTransactionsSenior
Answer preview
A deadlock is a cycle of transactions each waiting for a lock the next one holds, so none can ever proceed. The database cannot wait it out — it detects the cycle and kills one transaction as the deadlock victim.…