Deadlock error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I am working with an application with a high rate of
inserts/updates/deletes into a particular table, and recently am
getting the following error code. My table uses InnoDB engine.

ERROR 1213 (40001): Deadlock found when trying to get lock; try
restarting transaction

I read the section of MySQL documentation relating to this error and
deadlock detection in particular, but it does not appear to address my
following questions:

(a) Can an INSERT throw this error? Or is it applicable only to UPDATEs
and DELETEs (something about INSERT only locking the row inserted).

(b) Is there any configuration setting that can be tuned to reduce the
chances of this happening?  I know I could just retry the transaction,
but the application is pretty realtime and most times these database
calls are fire-and-forget.

Site Timeline