我有一個很少擴展的magento站點。主擴展程序是唯一代碼的giftcard擴展。我們現在正在使用800K代碼進行升級,因此它創造了巨大的流量。問題是現在它正在創造幽靈訂單作爲付款後 - 在訂單必須從預訂訂單註冊到確認的最後一刻 - 它顯示錶鎖定錯誤。magento超出鎖定等待超時sales_flat_order_grid
精確的錯誤是:
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: INSERT INTO
sales_flat_order_grid
(entity_id
,status
,store_id
,customer_id
,base_grand_total
,base_total_paid
,grand_total
,total_paid
,increment_id
,base_currency_code
,order_currency_code
,store_name
,created_at
,updated_at
,billing_name
,shipping_name
) SELECTmain_table
.entity_id
,main_table
.status
,main_table
.store_id
,main_table
.customer_id
,main_table
.base_grand_total
,main_table
.base_total_paid
,main_table
.grand_total
,main_table
.total_paid
,main_table
.increment_id
,main_table
.base_currency_code
,main_table
.order_currency_code
,main_table
.store_name
,main_table
.created_at
,main_table
.updated_at
, CONCAT(IFNULL(table_billing_name.firstname, ''), ' ', IFNULL(table_billing_name.middlename, ''), ' ', IFNULL(table_billing_name.lastname, '')) ASbilling_name
, CONCAT(IFNULL(table_shipping_name.firstname, ''), ' ', IFNULL(table_shipping_name.middlename, ''), ' ', IFNULL(table_shipping_name.lastname, '')) ASshipping_name
FROMsales_flat_order
ASmain_table
LEFT JOINsales_flat_order_address
AStable_billing_name
ONmain_table
.billing_address_id
=table_billing_name
.entity_id
LEFT JOINsales_flat_order_address
AStable_shipping_name
ONmain_table
.shipping_address_id
=table_shipping_name
.entity_id
WHERE (main_table.entity_id IN('140650')) ON DUPLICATE KEY UPDATEentity_id
= VALUES(entity_id
),status
= VALUES(status
),store_id
= VALUES(store_id
),customer_id
= VALUES(customer_id
),base_grand_total
= VALUES(base_grand_total
),base_total_paid
= VALUES(base_total_paid
),grand_total
= VALUES(grand_total
),total_paid
= VALUES(total_paid
),increment_id
= VALUES(increment_id
),base_currency_code
= VALUES(base_currency_code
),order_currency_code
= VALUES(order_currency_code
),store_name
= VALUES(store_name
),created_at
= VALUES(created_at
),updated_at
= VALUES(updated_at
),billing_name
= VALUES(billing_name
),shipping_name
= VALUES(shipping_name
)
似乎有效,但沒有提到:對於sales_flat_order_grid實體ID 140650。
如果任何人有任何想法,請讓我知道可能的解決方案。
如何將代碼移至commit_after? 我無法找到訂單在網格中保存訂單數據的代碼。 –