Beispiel #1
0
 /**
  * Commits the current transaction.
  *
  * @return void
  * @throws ConnectionException If the commit failed due to no active transaction or
  *                             because the transaction was marked for rollback only.
  */
 public function commit()
 {
     if ($this->_transactionNestingLevel == 0) {
         throw ConnectionException::noActiveTransaction();
     }
     if ($this->_isRollbackOnly) {
         throw ConnectionException::commitFailedRollbackOnly();
     }
     $this->connect();
     if ($this->_transactionNestingLevel == 1) {
         $this->_conn->commit();
     } else {
         if ($this->_nestTransactionsWithSavepoints) {
             $this->releaseSavepoint($this->_getNestedTransactionSavePointName());
         }
     }
     --$this->_transactionNestingLevel;
 }
 /**
  * Commits the current transaction.
  *
  * @return void
  *
  * @throws \Doctrine\DBAL\ConnectionException If the commit failed due to no active transaction or
  *                                            because the transaction was marked for rollback only.
  */
 public function commit()
 {
     if ($this->_transactionNestingLevel == 0) {
         throw ConnectionException::noActiveTransaction();
     }
     if ($this->_isRollbackOnly) {
         throw ConnectionException::commitFailedRollbackOnly();
     }
     $this->connect();
     $logger = $this->_config->getSQLLogger();
     if ($this->_transactionNestingLevel == 1) {
         if ($logger) {
             $logger->startQuery('"COMMIT"');
         }
         $this->_conn->commit();
         if ($logger) {
             $logger->stopQuery();
         }
     } else {
         if ($this->_nestTransactionsWithSavepoints) {
             if ($logger) {
                 $logger->startQuery('"RELEASE SAVEPOINT"');
             }
             $this->releaseSavepoint($this->_getNestedTransactionSavePointName());
             if ($logger) {
                 $logger->stopQuery();
             }
         }
     }
     --$this->_transactionNestingLevel;
 }
Beispiel #3
0
 /**
  * Commits the current transaction.
  *
  * @return void
  * @throws ConnectionException If the commit failed due to no active transaction or
  *                             because the transaction was marked for rollback only.
  */
 public function commit()
 {
     if ($this->_transactionNestingLevel == 0) {
         throw ConnectionException::noActiveTransaction();
     }
     if ($this->_isRollbackOnly) {
         throw ConnectionException::commitFailedRollbackOnly();
     }
     $this->connect();
     if ($this->_transactionNestingLevel == 1) {
         $this->_conn->commit();
     }
     --$this->_transactionNestingLevel;
 }