Showing results for 
Search instead for 
Did you mean: 

save customer - lock wait timeout

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());





I am running mysql 5.5.42, php 5.3, linx server




Tags (1)

Re: save customer - lock wait timeout

Hmm, normally it should not happen with this code. How many users do you have? If lot enough, probably it has sense to enlarge waiting time limit in mysql.ini ...
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 Smiley Happy

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).

Tanel Raja

Re: save customer - lock wait timeout

I have around 20000-25000 customer in magento.


restarted mysql, killed all deadlock, but still no luck