Hi,
I know that deadlocks occur inevitably when using transactions in Innodb and that they are harmless if they are treated properly by the application code - "just try it again", as the manual says.
So I was wondering - how do you detect deadlocks? Does a deadlock issue some special mysql error number? I am using PHP's mysqli extension if that matters.
Thank you.
Edit: solution found, see comments
From stackoverflow
-
Try MaatKit. It has a deadlock logger.
-
http://dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html
1213 (ER_LOCK_DEADLOCK)
Transaction deadlock. You should rerun the transaction.
raquo : Thank you! That's what I was looking for.S.Lott : Did you use Google? That's what I used. -
Try innotop, will detect the deadlock for you.
0 comments:
Post a Comment