src/Zicht/Bundle/AdminBundle/Doctrine/TransactionalRequestListener.php
public function onKernelResponse(KernelEvent $event)
    {
        if ($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST
            && $this->wasTxStarted
            && $this->doctrine->getConnection()->getTransactionIsolation() > 0) {

            if ($this->doctrine->getConnection()->isRollbackOnly()) {
                $this->doctrine->getConnection()->rollback();
            } else {
                $this->doctrine->getConnection()->commit();
            }
            $this->wasTxStarted = false;
        }
    }
public function onKernelResponse(KernelEvent $event)
    {
        if ($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST
            && $this->wasTxStarted
            && $this->doctrine->getConnection()->getTransactionIsolation() > 0) {

            if ($this->doctrine->getConnection()->isRollbackOnly()) {
                $this->doctrine->getConnection()->rollback();
            } else {
                $this->doctrine->getConnection()->commit();
            }
            $this->wasTxStarted = false;
        }
    }
public function onKernelResponse ( KernelEvent $ event ) { if ( $ event -> getRequestType ( ) === HttpKernelInterface :: MASTER_REQUEST && $ this -> wasTxStarted && $ this -> doctrine -> getConnection ( ) -> getTransactionIsolation ( ) > 0 ) { if ( $ this -> doctrine -> getConnection ( ) -> isRollbackOnly ( ) ) { $ this -> doctrine -> getConnection ( ) -> rollback ( ) ; } else { $ this -> doctrine -> getConnection ( ) -> commit ( ) ; } $ this -> wasTxStarted = false ; } }
Commits the transaction, if started

@param \Symfony\Component\HttpKernel\Event\KernelEvent $event
@return void
Commits the transaction if started