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, 7347🔥, 0💬
Popular Posts:
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINU...