This seems similar to other issues that have been created, but the error is slightly different and the fixes posted for other issues haven't worked for me.

I'm using Webforms 7.x-4.1, and if the same user submits a form twice in row the second submission gets the following error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3877-129' for key 3: INSERT INTO {webform_submissions} (nid, serial, uid, is_draft, submitted, remote_addr) 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); Array ( [:db_insert_placeholder_0] => 3877 [:db_insert_placeholder_1] => 129 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 1415045010 [:db_insert_placeholder_5] => IPADDRESS ) in drupal_write_record() (line 7202 of /home/website/public_html/includes/common.inc).

After the error you can hit the back button and submit the form without error, or just refresh the page, which re-submits the form, and it goes through without error.

Comments

DanChadwick’s picture

Status: Active » Closed (duplicate)

Try the latest dev, which fixes this issue. #2349081: Drush sql-sync and PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'xxx' for key 'nid_serial': INSERT INTO {webform_submissions}

Also, you might want to deploy some javascript to prevent duplicate form submission. If the user clicks "Submit" and then clicks it again before the page reloads, you end up with two submissions, such like everywhere else in Drupal. I use code that disables the submit button once it's clicked.