views:

176

answers:

2

Rollback failed. There is no active transaction.

I am getting the above error when i tried to rollback. I googled the issue and few suggested to disabling the autocommit..... How do we disable autocommit?

Is there any other reason for the above error?

I am using MYSQL and Zend and my php.ini file loaded the required drivers

Thanks in advance

A: 

MySQL works in autocommit by default. You can turn it off with:

$connection->setAttribute(Doctrine_Core::ATTR_AUTOCOMMIT, false);

Another idea I have is you didn't start the transaction (which should disable autocommit in Doctrine):

$connection->beginTransaction();
kuba
i couldn't understand how to post code in a comment so just posted as an answer
rahul
A: 

Found the problem.....I have called rollback() function 2 times in different places in the code

rahul