- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
save customer - lock wait timeout
Hi Any idea how to fix this?
I am try to save a data to a customer, but it returns
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction' in /srv/www/international/releases/20161108000228/shop/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /srv/www/international/releases/20161108000228/shop/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /srv/www/international/releases/20161108000228/shop/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /srv/www/international/releases/20161108000228/shop/lib/Zend/Db/Statement.php(320): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /srv/www/international/releases/20161108000228/shop/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /srv/www/international/releases/20161108000228/shop/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `mage_cu...', Array)
#5 /srv/www/international/releases/20161108000228/shop/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_ in /srv/www/international/releases/20161108000228/shop/lib/Zend/Db/Statement/Pdo.php on line 234
----------------
here is my code
$loadcus = Mage::getModel('customer/customer')->load($cus->getId());
$loadcus->setApId('2');
$loadcus->save();
I am running mysql 5.5.42, php 5.3, linx server
Thanks
Keith
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: save customer - lock wait timeout
Also, you can check what exactly query fall down with error. You can use show queries list command in phpmyadmin.
I have seen such error on very simple query, and it was there while I have not restarted mysql server.
Magento? it's really interesting.. BroSolutions like it

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: save customer - lock wait timeout
You're in world of pain when you run it inside a loop as it saturates your database query queue in no time (unless you have only handful of users).
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: save customer - lock wait timeout
I have around 20000-25000 customer in magento.
restarted mysql, killed all deadlock, but still no luck