MySQL Deadlocks 101
Sometimes when dealing with MySQL you might come across this slightly frustrating error: ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction This error message covers deadlocks – this is what we will try to explore in this post. What is a Deadlock? A deadlock occurs when different transactions are unable to proceed because each of them holds a lock that the other needs. As a result, none of the transactions succeed. This picture illustrates a…