Begin transaction (turns off autocommit mode).

@param bool $onlyIfNoActiveTransaction
@return bool
439741
public function beginTransaction($onlyIfNoActiveTransaction = false)
    {
        $this->connect();

        if ($onlyIfNoActiveTransaction && $this->hasActiveTransaction()) {
            return false;
        }

        $this->pdo->beginTransaction();
        $this->hasActiveTransaction = true;

        return true;
    }
720577
public boolean startTransaction() {
      EmbeddedTransaction tx = new EmbeddedTransaction(EmbeddedTransactionManager.getInstance());
      tx.setXid(xid);
      LocalTransaction localTransaction = transactionTable
            .getOrCreateLocalTransaction(tx, false, this::newGlobalTransaction);
      if (createGlobalState(localTransaction.getGlobalTransaction()) != Status.OK) {
         //no need to rollback. nothing is enlisted in the transaction.
         transactionTable.removeLocalTransaction(localTransaction);
         return false;
      } else {
         this.tx = tx;
         this.localTxInvocationContext = new LocalTxInvocationContext(localTransaction);
         perCacheTxTable.createLocalTx(xid, tx);
         transactionTable.enlistClientTransaction(tx, localTransaction);
         return true;
      }
   }
160767
public function startTransaction($transactionId = '')
    {
        $this->logger->debug(__FUNCTION__, 'Input Transaction ID: ' . json_encode($transactionId));
        if (empty($transactionId)) {
            $transactionId = date('YmdHis') . rand(100000, 999999);
        }
        $this->transactionId = $transactionId;
        $this->logger->debug(__FUNCTION__, 'Output Transaction ID: ' . json_encode($this->transactionId));

        return $this;
    }
487381
public function startTransaction(): bool {
        if ($this->transactionExists) {
            return false;
        }
        $started = $this->pdo->beginTransaction();
        $this->transactionExists = $started;
        return $started;
    }
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;
    }
908015
public function beginTransaction() {
		if ($this->inTransaction) {
			return false;
		}

		$this->inTransaction = $this->pdo->beginTransaction();
		return $this->inTransaction;
	}
936802
public function beginTransaction(): bool
    {
        if(!$this->inTransaction())
        {
            $result = $this->instance->beginTransaction();
            if(!$result)
            {
                return $result;
            }
        }
        $this->exec('SAVEPOINT P' . $this->getTransactionLevels());
        $this->__tBeginTransaction();
        return true;
    }
1284906
public function beginTransaction()
	{
		if($this->supportTransaction == false)
		{
			throw new LikePDOException("This driver doesn't support transactions");
			return false;
		}
		elseif($this->inTransaction == true)
		{
			throw new LikePDOException("There is already an active transaction");
			return false;
		}
		else
		{
			if(!$this->driver->beginTransaction())
			{
				throw new LikePDOException("Failed to begin transaction");
				return false;
			}
			
			return true;
		}
	}
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());
        }
    }
1292672
public function beginTransaction()
	{
		if( !$this->dbc )
			throw new RuntimeException( 'Database not conntected' );

		$this->openTransactions ++;
		if( $this->openTransactions == 1 )
		{
			if( self::$autoCommit )
				$this->execute( 'SET AUTOCOMMIT=0' );
			$this->execute( 'START TRANSACTION' );
		}
	}
427322
public function start( $autoCommit = 1 )
	{
		$this->openTransactions ++;
		if( $this->openTransactions == 1 )
		{
			if( $autoCommit )
			{
				$query = "SET AUTOCOMMIT=0";
			}
			$this->Execute( $query );
			$query = "START TRANSACTION";
			$this->Execute ($query);
		}
	}
1228083
public function beginTransaction() {
        ++$this->transactions;

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

        $this->fireConnectionEvent('beganTransaction');
    }
1346008
public static function startTransaction(callable $callback = null)
    {
        static::verifyConnection();

        if (!static::$adapter->getConnection()->inTransaction()) {
            static::$adapter->getConnection()->beginTransaction();
        }

        if (is_callable($callback)) {
            try {
                call_user_func_array($callback, []);

                static::commit();
            } catch (DatabaseException $e) {
                static::rollback();
            }
        }
    }
569539
public function transaction() {

		if(null === $this -> connection) {
			$this -> connect();
		}

		$this -> connection -> autocommit(false);
		$this -> connection -> begin_transaction(MYSQLI_TRANS_START_READ_WRITE);

		return $this;
	}
561243
public function beginTransaction()
    {
        $return = true;
        $opcount = $this->getNestedTransactionCount();
        if ($opcount === 0) {
            $return = self::exec('BEGIN TRANSACTION');
            if ($this->useDebug) {
                $this->log('Begin transaction', null, __METHOD__);
            }
            $this->isUncommitable = false;
        }
        $this->nestedTransactionCount++;

        return $return;
    }
389771
public function commitTransaction()
    {
        $this->connect();
        if (!$this->_connection->inTransaction()) {
            return false;
        }

        return $this->_connection->commit();
    }
406767
public function transactionCommit()
    {
        if (empty($this->oDb)) {
            $this->connect();
        }

        try {

            $this->oDb->commit();
            $this->transactionRunning = false;

            return true;

        } catch (\Exception $e) {
            throw new TransactionException($e->getMessage(), $e->getCode());
        }
    }