PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; I am getting the following error on my D7 site:

PDOException: SQLSTATE[40001]: Serialization failure: 1213 
Deadlock found when  trying to get lock; try restarting transaction: 
INSERT INTO {node} (type, language, title, uid, status, created, changed, promote, sticky) 
VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, 
:db_insert_placeholder_3, :db_insert_placeholder_4,
:db_insert_placeholder_5, :db_insert_placeholder_6,
:db_insert_placeholder_7, :db_insert_placeholder_8); Array
(
[:db_insert_placeholder_0] =&gt; baby_clothes
[:db_insert_placeholder_1] =&gt; und
[:db_insert_placeholder_2] =&gt; Boys clothes and swing
[:db_insert_placeholder_3] =&gt; 1
[:db_insert_placeholder_4] =&gt; 1
[:db_insert_placeholder_5] =&gt; 1333240131
[:db_insert_placeholder_6] =&gt; 1333240131
[:db_insert_placeholder_7] =&gt; 1
[:db_insert_placeholder_8] =&gt; 0
)

in drupal_write_record() (line 6975 of includes/common.inc).


I have a module that saves nodes programatically on cron run.  There is the possibiliy that two nodes could save simultaneously.  Is that what could be causing this? The table locking mechanism is not working correctly to prevent collisions? If I put the site in maintenance mode and just run the batch of nodes to be saved, this never happens. Thoughts? thanks!
This is a known issue in drupal 7.x core and has been resolved in the latest release (see this bug report for more information). Make sure you've upgraded to the latest version of Drupal 7, or try applying the patch if you need to get your site operational.