Collections:
Error: Deadlock Found When Trying to Get Lock in MySQL
What Happens to Your Transactions When ERROR 1213 Occurred in MySQL?
✍: FYIcenter.com
If your transaction receives the "Deadlock found when trying to get lock" - ERROR 1213, MySQL server automatically terminates your transaction and rolls back your data changes of the entire transaction. This is why the error messages tells you to "try restarting transaction".
At the same time, locks owned by the terminated (rolled back) transaction will be released.
MySQL server will not touch the other transaction. But the block will be removed, since the lock owned the terminated transaction is released. The other transaction will be able to continue normally.
Note that MySQL server automatically detects dead locks and resolved them by rollback actions.
⇒ Locks, Timeouts, and Deadlocks in MySQL
⇐ Experiment with Dead Locks in MySQL
2017-07-21, 7551🔥, 0💬
Popular Posts:
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations per...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
How To Concatenate Two Binary Strings Together in SQL Server Transact-SQL? SQL Server 2005 allows to...
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
What are binary literals supported in SQL Server Transact-SQL? Binary literals in Transact-SQL are s...