简体   繁体   English

商业订单-PDOException:SQLSTATE [40001]:序列化失败:1213尝试获取锁时发现了死锁;默认值为0。 尝试重新启动事务

[英]COMMERCE ORDER - PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Here is my error message 这是我的错误信息

PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when 
trying to get lock; try restarting transaction: 
UPDATE {commerce_order} SET 
order_number=:db_update_placeholder_0, revision_id=:db_update_placeholder_1, 
type=:db_update_placeholder_2, uid=:db_update_placeholder_3, 
mail=:db_update_placeholder_4, status=:db_update_placeholder_5, 
created=:db_update_placeholder_6, changed=:db_update_placeholder_7, 
placed=:db_update_placeholder_8, hostname=:db_update_placeholder_9, 
data=:db_update_placeholder_10 WHERE (order_id = :db_condition_placeholder_0) ; 
Array ( [:db_update_placeholder_0] => 201805822 [:db_update_placeholder_1] => 16807 
[:db_update_placeholder_2] => commerce_order [:db_update_placeholder_3] => 0 
[:db_update_placeholder_4] => [:db_update_placeholder_5] => checkout_checkout 
[:db_update_placeholder_6] => 1540480400 [:db_update_placeholder_7] => 
1540481979 [:db_update_placeholder_8] => 0 [:db_update_placeholder_9] => 
128.199.161.50 [:db_update_placeholder_10] => a:4: 
{s:17:"last_cart_refresh";i:1540481976;s:16:"shipping_service";s:17:"shipping_custom|1";s:14:"with_backorder";s:0:"";s:17:"backorder_service";s:5:"_none";}
[:db_condition_placeholder_0] => 5056 ) in drupal_write_record() (line 7387 of ~/public_html/includes/common.inc).

anyone can help me? 有人可以帮助我吗? whats wrong with that things? 那东西怎么了?

The best fix is changing your transaction isolation level (to READ COMMITTED). 最好的解决方法是更改​​事务隔离级别(更改为“已读”)。

Try adding this to your settings.php . 尝试将其添加到settings.php It's a common problem in high read/write Drupal sites with many fields. 在具有许多字段的高级Drupal站点中,这是一个常见问题。

$databases['default']['default']['init_commands'] = array(
  'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'"
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM