Doctrine2 module to rollback only on active transaction only

I made a small fix to rollback only on an active transaction. Sometimes, it may be possible that the transaction has been cut off or already rollbacked due to an error and instead of showing that error the Doctrine2 Module will throw the "Invalid transaction" error.