/** * @inheritdoc * @throws ConnectionException */ public function rollBack() { if ($this->isWrapped && parent::getTransactionNestingLevel() === 1) { throw ConnectionException::noActiveTransaction(); } parent::rollBack(); }
/** * Checks whether the current transaction is marked for rollback only. * * @return boolean * * @throws \Doctrine\DBAL\ConnectionException If no transaction is active. */ public function isRollbackOnly() { if ($this->_transactionNestingLevel == 0) { throw ConnectionException::noActiveTransaction(); } return $this->_isRollbackOnly; }