title: Cant update product in Magento
body: <p>I am having some problems when I try and update a product. Lets say i want to add product to a new category, when i click save it just keeps loading, nothing happens.</p>
  
  <p>Problems started when I enabled <code>flat_catalog</code>, when I tried to build table with <code>"Reindex all"</code>, server could not handle sql threads, so i needed to disable <code>flat_category</code> again.</p>
  
  <p>In <strong>error logs</strong> i see <code>SQL timeout</code>. Any suggestions to what can be problem?</p>
  
  <p>This is from log:</p>
  
  <pre><code>   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-&gt;execute(Array)
  #1 /var/www/webshop.com/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo-&gt;_execute(Array)
  #2 /var/www/webshop.com/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql-&gt;_execute(Array)
  #3 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement-&gt;execute(Array)
  #4 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract-&gt;query('UPDATE `catalog...', Array)
  #5 /var/www/webshop.com/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract-&gt;query('UPDATE `catalog...', Array)
  #6 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_Adapter_Pdo_Mysql-&gt;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-&gt;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-&gt;_processSaveData(Array)
  #9 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Eav_Model_Entity_Abstract-&gt;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-&gt;save()
  #11 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController-&gt;saveAction()
  #12 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action-&gt;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-&gt;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-&gt;dispatch()
  #15 /var/www/webshop.com/public_html/app/Mage.php(683): Mage_Core_Model_App-&gt;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-&gt;_execute(Array)
  #1 /var/www/webshop.com/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql-&gt;_execute(Array)
  #2 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement-&gt;execute(Array)
  #3 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract-&gt;query('UPDATE `catalog...', Array)
  #4 /var/www/webshop.com/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract-&gt;query('UPDATE `catalog...', Array)
  #5 /var/www/webshop.com/public_html/lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_Adapter_Pdo_Mysql-&gt;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-&gt;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-&gt;_processSaveData(Array)
  #8 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Eav_Model_Entity_Abstract-&gt;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-&gt;save()
  #10 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController-&gt;saveAction()
  #11 /var/www/webshop.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action-&gt;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-&gt;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-&gt;dispatch()
  #14 /var/www/webshop.com/public_html/app/Mage.php(683): Mage_Core_Model_App-&gt;run(Array)
  #15 /var/www/webshop.com/public_html/index.php(111): Mage::run('default', 'store')
  #16 {main}
  </code></pre>