in reply to fetchrow_hashref failed problem

If you are using InnoDB or any row-level transactional RDBMS, then it is possible that any write transaction can cause a deadlock, even in perfectly normal situations. Larger tables, larger writes, and long transaction blocks will often increase the likelihood of deadlocks occurring.

The only way to truly handle deadlocks is to write your code to expect them. This generally is not very difficult if your database code is well written. Often you can just put a try/catch around the query execution logic and look for a deadlock when errors occur. If you catch one, the normal thing to do is just attempt to execute the failed query again.

Read How to Cope with Deadlocks

Source from Working around MySQL error "Deadlock found when trying to get lock; try restarting transaction"


All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^2: fetchrow_hashref failed problem
by dcunningham (Sexton) on Jul 21, 2015 at 07:07 UTC
    Thank you, but the deadlock is not the problem. It's the fetchrow_hashref error following the execute.