title: Call a function when product imported successfully in magento
body: <p>Hello I am importing products in magneto programatically using Advance import profile and I want to run re-index after the whole import is finished. I have tried digging the magento, But can't find any function that is being called after importing is finished...</p>
  
  <p>I have found a file process.phtml that is calling ajax for each csv row /app/design/adminhtml/default/default/template/system/convert/profile</p>
  
  <p>So I have created a file on the root and call it via ajax to import each row, But it created a deadlock in Mysql and import throws error SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get locked; try restarting transaction.</p>
  
  <pre><code>function reIndexData(){
                          var url = '&lt;?php echo str_replace("index.php/","",Mage::getBaseUrl()); ?&gt;';
                           new Ajax.Request(url+'reindex.php', {
                            method: "post",
                            parameters: 'data',
                            onSuccess: function(transport) {}
                          });
                      }
  </code></pre>