Each occurance of beginTransaction() must be matched with commit().
Only when same amount of commits are executed, the ACTUAL commit will be
issued to the database.

@see beginTransaction()

@return mixed Don't rely on any meaningful return
337444
public function commit()
    {
        --$this->transaction_depth;

        // This means we rolled something back and now we lost track of commits
        if ($this->transaction_depth < 0) {
            $this->transaction_depth = 0;
        }

        if ($this->transaction_depth == 0) {
            return $this->dbh->commit();
        }

        return false;
    }
363530
public function commitTransaction() {
        $this->_fireEvent('phpsweetpdo.commit_transaction.started', array ());
        $result = $this->_pdoObject->commit();
        $this->_fireEvent('phpsweetpdo.commit_transaction.finished', array ('result' => &$result));

        return $result;
    }
212648
public function endTransaction()
    {
        $this->db_connect('w', true);

        // check connection before proceeding
        if (!$this->is_connected()) {
            return $this->last_result = false;
        }

        $this->debug('COMMIT TRANSACTION');

        if ($result = @oci_commit($this->dbh)) {
            $this->in_transaction = true;
        }
        else {
            $this->handle_error('COMMIT');
        }

        return $this->last_result = $result;
    }
386994
public function beginTransaction() {
        // check if a transaction is already active
        if ($this->getConnection()->inTransaction())
            throw new \Exception("Already inside a DB transaction. You need to commit it before beginning a new one.");

        try {
            // No need to check for the connection again
            $this->getConnection(false)->beginTransaction();
        } catch (Exception $_e) {
            throw new \Exception("Error while beginning DB transaction: ".$pe->getMessage());
        }
    }
1038949
public function beginTransaction() : bool
    {
        if ($this->dbconn->inTransaction()) {
            throw new TransactionErrorException("A transaction has already been started.");
        }
        try {
            return $this->dbconn->beginTransaction();
        } catch (\PDOException $exception) {
            throw new TransactionsNotSupportedException("Transactions are not supported in this database.");
        }
    }
490480
public static function beginTransaction()
    {
        if (static::inTransaction()) {
            throw new PDOException();
        }

        static::inTransaction(true);

        $transaction = static::makeTransaction(static::countTransactions());

        static::addTransaction($transaction);
    }
651542
public function beginTransaction()
    {
        if (!$this->activeTransaction === false) {
            return;
        }

        if ($this->connection->autocommit(false)) {
            $this->activeTransaction = uniqid();
            return $this->activeTransaction;
        }
    }
1038608
public function beginTransaction() : bool
    {
        $result = @$this->getConnection()->exec('BEGIN TRANSACTION');

        if ($result === false) {
            throw new ParserRuntimeException('Transaction could not be started.', 0);
        }

        return $result;
    }
255302
public function commit()
    {
        if (!$this->_transactionStarted) {
            return false;
        }

        if ($this->_transactionLevel === 0) {
            if ($this->wasNestedTransactionRolledback()) {
                $e = $this->nestedTransactionRollbackException;
                $this->nestedTransactionRollbackException = null;
                throw $e;
            }

            $this->_transactionStarted = false;
            $this->nestedTransactionRollbackException = null;
            if ($this->_logQueries) {
                $this->log('COMMIT');
            }

            return $this->_driver->commitTransaction();
        }
        if ($this->isSavePointsEnabled()) {
            $this->releaseSavePoint((string)$this->_transactionLevel);
        }

        $this->_transactionLevel--;

        return true;
    }
1225742
function begin() {
		$this->dbh or $this->setup();

		if ($this->savepoint == 0) {
			$this->dbh->beginTransaction();
		}
		else { // already in a transaction
			$this->dbh->exec('SAVEPOINT save'.$this->savepoint);
		}

		$this->savepoint++;
		return $this;
	}
1196000
public function rollbackTransaction() {
        $this->_fireEvent('phpsweetpdo.rollback_transaction.started', array ());
        $result = $this->_pdoObject->rollBack();
        $this->_fireEvent('phpsweetpdo.rollback_transaction.finished', array ('result' => &$result));

        return $result;
    }
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;
    }
961677
public function beginTransaction()
    {
        $return = true;
        if (!$this->nestedTransactionCount) {
            $return = parent::beginTransaction();
            if ($this->useDebug) {
                $this->log('Begin transaction', null, __METHOD__);
            }
            $this->isUncommitable = false;
        }
        $this->nestedTransactionCount++;

        return $return;
    }
315388
public function beginDatabaseTransaction()
    {
        $database = $this->app->make('db');

        foreach ($this->connectionsToTransact() as $name) {
            $connection = $database->connection($name);
            $dispatcher = $connection->getEventDispatcher();

            $connection->unsetEventDispatcher();
            $connection->beginTransaction();
            $connection->setEventDispatcher($dispatcher);
        }

        $this->beforeApplicationDestroyed(function () use ($database) {
            foreach ($this->connectionsToTransact() as $name) {
                $connection = $database->connection($name);
                $dispatcher = $connection->getEventDispatcher();

                $connection->unsetEventDispatcher();
                $connection->rollback();
                $connection->setEventDispatcher($dispatcher);
                $connection->disconnect();
            }
        });
    }
1186475
public function commit()
    {
        $this->_connect();
        $q = $this->_profiler->queryStart('commit', Zend_Db_Profiler::TRANSACTION);
        $this->_commit();
        $this->_profiler->queryEnd($q);
        return $this;
    }
389771
public function commitTransaction()
    {
        $this->connect();
        if (!$this->_connection->inTransaction()) {
            return false;
        }

        return $this->_connection->commit();
    }
1263117
protected function beginTransaction()
    {
        $modelClass = $this->modelClass;
        $transaction = $modelClass::getDb()->beginTransaction();

        $this->_transaction[] = $transaction;
    }