[development] Can the new D7 database api handle ER_LOCK_DEADLOCK?

Jonathan Brown jbrown at bluedroplet.com
Tue Nov 10 05:31:56 UTC 2009


Database transactions are always susceptible to deadlock:
http://dev.mysql.com/doc/refman/5.0/en/innodb-deadlocks.html

Looking at the last example on this page:
http://api.drupal.org/api/group/database/7

Surely in catch{}, the exception should be examined for
ER_LOCK_DEADLOCK?

The entire transaction could be in a do-while loop, so it is continually
reattempted until the transaction does not deadlock.

ER_LOCK_DEADLOCK is mysql specific. Does the new db layer have an
abstraction for this?


-- 
Jonathan Brown

Blue Droplet Media
http://bluedroplet.com/




More information about the development mailing list