Commit transaction

@return $this
@throws DB\Exception
345976
public function commit()
    {
        $res = null;

        if ($this->transLevel == 0) {
            $this->cleanAfterCommit();
            throw $this->createException('Commit without transaction');
        }

        if (!empty($this->transLevelRolledBack[$this->transLevel])) {
            $this->transLevel--;
            return $this;
        }

        if (empty($this->pendingTransactionBegin[$this->transLevel])) {
            $this->dbTransLevel--;

            if ($this->dbTransLevel == 0) {
                $res = pg_query($this->pgConn, 'commit');
            }

            if ($res === false) {
                $this->cleanAfterCommit();
                throw $this->createException();
            }
        }

        $this->afterCommit();
        $this->transLevel--;

        return $this;
    }
89898
public function transaction($callback)
    {
        $connection = $this->getConnection();
        $connection->beginTransaction();

        if ($callback instanceof Closure) {
            $callback = $callback->bindTo($this, get_class($this));
        }

        if (call_user_func($callback, $this) === false) {
            $connection->rollBack();
        } else {
            $connection->commit();
        }

        return $this;
    }
247073
private function commit()
    {
        if ($this->inTransaction) {
            try {
                // commit read-write transaction which also releases the lock
                if ('sqlite' === $this->driver) {
                    $this->pdo->exec('COMMIT');
                } else {
                    $this->pdo->commit();
                }
                $this->inTransaction = false;
            } catch (\PDOException $e) {
                $this->rollback();

                throw $e;
            }
        }
    }
377653
public function reindexAll()
    {
        $this->tableStrategy
			->setUseIdxTable(false);
		
        $this->beginTransaction();
        try {
            $this->reindex();
            $this->commit();
        } catch (\Exception $e) {
            $this->rollBack();
            throw $e;
        }
        return $this;
    }
957581
public function commit()
    {
        foreach ($this->transaction as $trans) {
            $this->internalLog($trans['level'], $trans['message'], $trans['time'], $trans['context']);
        }

        $this->rollback();
    }
478340
public function commit ()
	{

		if (--$this->transactionCount === 0)
		{
			
			$status	= parent::commit ();
			
			// Commit any hooked databases
			
			if ($this->_transaction_hooks)
			{
				
				if ($status)
				{
					foreach ($this->_transaction_hooks as $dsn => &$db)
					{
						$db->commit ();
					}
				}
				
				$this->_transaction_hooks	= array ();
				
			}
			
			return $status;
			
		}
		else
		{
			return FALSE;
		}

	}
631104
public function commitTransaction($which_connection='')
    {
        if ($which_connection == '') {
            $which_connection = $this->default_db;
        }

        return $this->connections[$which_connection]->CommitTrans();
    }
806471
public function commit(): Promise
    {
        if ($this->handle === null) {
            throw new TransactionError("The transaction has been committed or rolled back");
        }

        $promise = $this->handle->query("COMMIT");
        $this->handle = null;
        $promise->onResolve($this->release);

        return $promise;
    }
863985
public function commitTransaction()
    {
        // fire model save again, to give Laravel app final chance to finalise anything that needs finalising after
        // batch processing
        foreach (self::$touchList as $model) {
            $model->save();
        }

        DB::commit();
        self::$touchList = [];
        self::$inBatch = false;
    }
487595
public function commit()
    {
        if ($this->transactionNestingLevel === 0) {
            throw ConnectionException::noActiveTransaction();
        }
        if ($this->isRollbackOnly) {
            throw ConnectionException::commitFailedRollbackOnly();
        }

        $connection = $this->getWrappedConnection();

        $logger = $this->_config->getSQLLogger();

        if ($this->transactionNestingLevel === 1) {
            if ($logger) {
                $logger->startQuery('"COMMIT"');
            }

            $connection->commit();

            if ($logger) {
                $logger->stopQuery();
            }
        } elseif ($this->nestTransactionsWithSavepoints) {
            if ($logger) {
                $logger->startQuery('"RELEASE SAVEPOINT"');
            }
            $this->releaseSavepoint($this->_getNestedTransactionSavePointName());
            if ($logger) {
                $logger->stopQuery();
            }
        }

        --$this->transactionNestingLevel;

        if ($this->autoCommit !== false || $this->transactionNestingLevel !== 0) {
            return true;
        }

        $this->beginTransaction();

        return true;
    }
1064463
public function commit() {
		if (!$this->inTransaction) {
			return false;
		}

		$this->inTransaction = false;
		return $this->pdo->commit();
	}
778484
public function commitTransaction()
    {

        if (empty($this->transactions) || !is_array($this->transactions)) {
            throw new QueryException(t("No transaction queries found"));
            $this->transactions = array();


            $this->resourceId->autocommit(TRUE); //Turns autocommit back on
            return false;
        }
        //Query transactions
        foreach ($this->transactions as $query) {


            if (!$this->exec($query)) {

                $this->resourceId->rollback(); //Rolls back the transaction;
                $this->transactions = array();
                $this->resourceId->autocommit(TRUE); //Turns autocommit back on


                return false;
            }
        }

        //Commit the transaction
        if (!$this->resourceId->commit()) {
            throw new QueryException(t("The transaction could not be committed"));
            $this->transactions = array();
            $this->resourceId->autocommit(TRUE); //Turns autocommit back on
            return false;
        }

        $this->transactions = array();
        $this->resourceId->autocommit(TRUE); //Turns autocommit back on
        return true;
    }
649471
public function rollBack()
    {
        if (!$this->getIsActive()) {
            // do nothing if transaction is not active: this could be the transaction is committed
            // but the event handler to "commitTransaction" throw an exception
            return;
        }

        $this->_level--;
        if ($this->_level === 0) {
            Log::debug('Roll back transaction' . __METHOD__);
            $this->db->pdo->rollBack();
            $this->db->trigger(Connection::EVENT_ROLLBACK_TRANSACTION);
            return;
        }

        $schema = $this->db->getSchema();
        if ($schema->supportsSavepoint()) {
            Log::debug('Roll back to savepoint ' . $this->_level . __METHOD__);
            $schema->rollBackSavepoint('LEVEL' . $this->_level);
        } else {
            Log::info('Transaction not rolled back: nested transaction not supported' . __METHOD__);
            // throw an exception to fail the outer transaction
            throw new Exception('Roll back failed: nested transaction not supported.');
        }
    }
187696
public function commitTransaction(): bool
    {
        --$this->transactionLevel;

        if ($this->transactionLevel == 0) {
            $this->isProfiling() && $this->getLogger()->info('Commit transaction');

            try {
                return $this->getPDO()->commit();
            } catch (\PDOException $e) {
                throw $this->mapException($e, "COMMIT TRANSACTION");
            }
        }

        $this->savepointRelease($this->transactionLevel + 1);

        return true;
    }
664684
public function commitTransaction(): bool
	{
		if($this->transactionNestingLevel > 0 && --$this->transactionNestingLevel === 0)
		{
			return $this->pdo->commit();
		}

		return false;
	}
553736
function commit()
    {
        if ($this->transaction_level > 0){
            $this->transaction_level--;
            if ($this->transaction_level == 0){
                return parent::commit();
            }
            return true;
        }
        return false;
    }
20181
protected function commit_transaction() {
        $this->query_start('--oracle_commit', NULL, SQL_QUERY_AUX);
        $result = oci_commit($this->oci);
        $this->commit_status = OCI_COMMIT_ON_SUCCESS;
        $this->query_end($result);
    }