mysql deadlocks
A situation where different transactions are unable to proceed, because each holds a lock that the other needs. Because both transactions are waiting for a resource to become available, neither will ever release the locks it holds.
A deadlock can occur when the transactions lock rows in multiple tables (through statements such as
UPDATE
or SELECT ... FOR UPDATE
), but in the opposite order. A deadlock can also occur when such statements lock ranges of index records and gaps, with each transaction acquiring some locks but not others due to a timing issue.
For background information on how deadlocks are automatically detected and handled, see Section 14.5.5.2, “Deadlock Detection and Rollback”. For tips on avoiding and recovering from deadlock conditions, see Section 14.5.5.3, “How to Minimize and Handle Deadlocks”.
Comments
Post a Comment