Overrides PDO::beginTransaction() to prevent errors due to already-in-progress transaction.

@return boolean
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;
    }
1349554
public function beginTransaction()
    {
        try {
            $this->connection->beginTransaction();
        } catch (DBALException $e) {
            throw new OrmException("Unable to start transaction.\n" . $e->getMessage(), 0, $e);
        }
    }
308985
public function inTransaction(): bool
    {
        $status = pg_transaction_status($this->getResource());

        return PGSQL_TRANSACTION_INTRANS === $status || PGSQL_TRANSACTION_INERROR === $status;
    }
1208054
public function rollbackTransaction(): bool
    {
        --$this->transactionLevel;

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

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

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

        return true;
    }
1184567
public function beginTransaction()
    {
        if (! $this->isValid()) return;

        foreach ($this->getConnections() as $connection) {
            if (! $connection->inTx()) $connection->beginTransaction();
        }
    }
670492
public function commit()
    {
        if (!$this->isTransaction()) {
            throw new PDOException('There is no active transaction');
        }
        $ret = $this->pool->commit($this->_bingId);
        $this->_bingId = null;
        $this->_isTransaction = false;
        return $ret;
    }
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();
            }
        });
    }
790210
protected function transactionStart() {
		if ( $this->transactionCounter == 0 ) {
			$this->transactionCounter++;
			return $this->dbh->beginTransaction();
		}
		$this->transactionCounter++;
		return $this->transactionCounter >= 0;
	}
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;
	}
1063395
public function beginTransaction()
	{
		++$this->transactions;

		if ( $this->transactions == 1 )
		{
			try
			{
				$this->getPdo()->beginTransaction();
			}
			catch ( Exception $e )
			{
				--$this->transactions;

				throw $e;
			}
		}
		elseif ( $this->transactions > 1 && $this->queryGrammar->supportsSavepoints() )
		{
			$this->getPdo()->exec( $this->queryGrammar->compileSavepoint( 'trans' . $this->transactions ) );
		}

		$this->fireConnectionEvent( 'beganTransaction' );
	}
612495
public function begin()
    {
        $this->current = $this->current instanceof Transaction
            ? $this->current->newTransaction()
            : new Transaction;
    }
969477
public function beginTransaction()
    {
        ++$this->transactions;

        if ($this->transactions == 1) {
            $this->pdo->beginTransaction();
        }

        $this->fireConnectionEvent('beganTransaction');
    }
920947
public function rollback(): bool {
        if ($this->transactionExists) {
            $rolledBack = $this->pdo->rollBack();
            $this->transactionExists = !$rolledBack;
            return $rolledBack;
        }
        return false;
    }
651542
public function beginTransaction()
    {
        if (!$this->activeTransaction === false) {
            return;
        }

        if ($this->connection->autocommit(false)) {
            $this->activeTransaction = uniqid();
            return $this->activeTransaction;
        }
    }
1208584
public function commitTransaction() {
		$request = new CPS_CommitTransactionRequest();
		$this->_lastResponse = $this->_connection->sendRequest($request);
		return true;
	}
968485
public function beginTransaction()
    {
        $return = $this->repository->beginTransaction();

        if ($this->signalDispatcher instanceof TransactionHandler) {
            $this->signalDispatcher->beginTransaction();
        }

        return $return;
    }
490480
public static function beginTransaction()
    {
        if (static::inTransaction()) {
            throw new PDOException();
        }

        static::inTransaction(true);

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

        static::addTransaction($transaction);
    }