Database Deadlocks
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBEM4B7hTATTnhvyDXjYLX1E3DwVr8Kh9mdYOQ9mxv8fWW8XYxwXBaA7ijl_sPoDRopJ2jnf-xcqh7UZhZhZ_Ybpj97rD6rMTKeEB2AQl3zSrMJC1coxo8Vm5jVIb2TAoijPmpxmHQYo/s16000/deadlock-scheme.jpg)
I have had to explain database deadlocks several times and I had this old code project to produce a database deadlock and I had the following scheme for explanation: However it was a bit too little or too confusing to get the idea through sometimes, so I retired the project and recreated a new one on the newest Symfony. It runs on Docker and produces a deadlock by running just one command. It’s on Github: https://github.com/varfrog/deadlock-symfony . The main point is that a deadlock happens when the same records are being locked by different processes in a different sequence. More on this in the README of the project.