Here is some good information on how to avoid deadlocks in mysql: http://dev.mysql.com/doc/refman/5.0/en/innodb-deadlocks.html
One of the more interesting points is * Always be prepared to re-issue a transaction if it fails due to deadlock. Deadlocks are not dangerous. Just try again
And at http://stackoverflow.com/questions/2596005/working-around-mysql-error-deadlock-found-when-trying-to-get-lock-try-restarti it mentions "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."
So we could try that for a start
Here is some good information on how to avoid deadlocks in mysql: http:// dev.mysql. com/doc/ refman/ 5.0/en/ innodb- deadlocks. html
One of the more interesting points is
* Always be prepared to re-issue a transaction if it fails due to deadlock. Deadlocks are not dangerous. Just try again
And at http:// stackoverflow. com/questions/ 2596005/ working- around- mysql-error- deadlock- found-when- trying- to-get- lock-try- restarti it mentions
"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."
So we could try that for a start