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, 7124🔥, 0💬
Popular Posts:
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a st...
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parame...
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Ex...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...