无法更新Magento的产品

时间:2013-12-22 19:51:07

标签: php sql magento zend-framework

我在尝试更新产品时遇到了一些问题。假设我想将产品添加到新类别,当我点击保存它只是继续加载,没有任何反应。

当我启用flat_catalog时出现问题,当我尝试使用"Reindex all"构建表时,服务器无法处理sql线程,因此我需要再次禁用flat_category

错误日志中,我看到SQL timeout。对什么可能有问题的任何建议?

这是来自日志:

   exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1205 Lock wait         timeout exceeded; try restarting transaction' in        /var/www/webshop.com/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/webshop.com/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/webshop.com/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/webshop.com/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `catalog...', Array)
#5 /var/www/webshop.com/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `catalog...', Array)
#6 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `catalog...', Array)
#7 /var/www/webshop.com/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1357): Zend_Db_Adapter_Abstract->update('catalog_product...', Array, '`entity_id`=309...')
#8 /var/www/webshop.com/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1123): Mage_Eav_Model_Entity_Abstract->_processSaveData(Array)
#9 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Eav_Model_Entity_Abstract->save(Object(Mage_Catalog_Model_Product))
#10 /var/www/webshop.com/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(728): Mage_Core_Model_Abstract->save()
#11 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->saveAction()
#12 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#13 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 /var/www/webshop.com/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#16 /var/www/webshop.com/public_html/index.php(111): Mage::run('default', 'store')
#17 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction' in /var/www/webshop.com/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /var/www/webshop.com/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/webshop.com/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `catalog...', Array)
#4 /var/www/webshop.com/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `catalog...', Array)
#5 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `catalog...', Array)
#6 /var/www/webshop.com/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1357): Zend_Db_Adapter_Abstract->update('catalog_product...', Array, '`entity_id`=309...')
#7 /var/www/webshop.com/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1123): Mage_Eav_Model_Entity_Abstract->_processSaveData(Array)
#8 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Eav_Model_Entity_Abstract->save(Object(Mage_Catalog_Model_Product))
#9 /var/www/webshop.com/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(728): Mage_Core_Model_Abstract->save()
#10 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->saveAction()
#11 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#12 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/webshop.com/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#15 /var/www/webshop.com/public_html/index.php(111): Mage::run('default', 'store')
#16 {main}

1 个答案:

答案 0 :(得分:0)

首先通过起诉flat清除DELETE FROM table;表,然后通过shell启动magento外的索引

Unix

Windows

如果您仍然收到错误,那么它是您的sql实例中的设置,更改设置并重新启动服务器以进行更改,然后重新开始。您可以在之后将其更改回来,因为您只需要执行重新索引