Start a transaction

POST /v1/projects/{projectId}:beginTransaction

@param bool $bol_cross_group
@return null
@throws \Exception
437290
public function beginTransaction($bol_cross_group = FALSE)
    {
        if($bol_cross_group) {
            throw new \Exception("Cross group transactions not supported over REST API v1");
        }
        $this->executePostRequest('beginTransaction');
        if(isset($this->obj_last_response->transaction)) {
            return $this->obj_last_response->transaction;
        }
        return null;
    }
827152
public function begin() {
        if ($this->transactionLevel < 0) throw new RuntimeException('Negative transaction nesting level detected: '.$this->transactionLevel);

        if (!$this->transactionLevel)
            $this->execute('start transaction');

        $this->transactionLevel++;
        return $this;
    }
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.");
        }
    }
777330
final public function transBegin()
    {
        $this->logger->info('-- TRANSACTION BEGIN');
        if (0 === $this->transactionLevel) {
            $this->commandTransactionBegin();
        } else {
            $this->commandSavepoint("LEVEL_{$this->transactionLevel}");
        }
        $this->transactionLevel = $this->transactionLevel + 1;
    }
608472
protected function begin_transaction() {
        // Recordsets do not work well with transactions in SQL Server,
        // let's prefetch the recordsets to memory to work around these problems.
        foreach ($this->recordsets as $rs) {
            $rs->transaction_starts();
        }

        $this->query_start('native sqlsrv_begin_transaction', NULL, SQL_QUERY_AUX);
        $result = sqlsrv_begin_transaction($this->sqlsrv);
        $this->query_end($result);
    }
302001
public function start_transaction()
	{
		$result = true;

		if ($this->_transaction_depth == 0)
		{
			if ($this->driver_start_transaction())
			{
				$this->_in_transaction = true;
			}
			else
			{
				$result = false;
			}
		}
		else
		{
			$result = $this->set_savepoint($this->_transaction_depth);
			// If savepoint is not supported it is not an error
			isset($result) or $result = true;
		}

		$result and $this->_transaction_depth ++;

		return $result;
	}
908788
private function OpenTransaction(){
        if(!$this->transactionActive) {
            $this->beginTransaction();
            $this->exec("SET FOREIGN_KEY_CHECKS = 0;");
            $this->transactionActive = true;
        }
    }
1158535
protected function begin_transaction() {
        if (!$this->transactions_supported()) {
            return;
        }

        $sql = "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED";
        $this->query_start($sql, NULL, SQL_QUERY_AUX);
        $result = $this->mysqli->query($sql);
        $this->query_end($result);

        $sql = "START TRANSACTION";
        $this->query_start($sql, NULL, SQL_QUERY_AUX);
        $result = $this->mysqli->query($sql);
        $this->query_end($result);
    }
423788
public function beginTransaction()
    {
        $this->assertIsSupported($this->supportsTransactions, __METHOD__);
        $this->wrapped->getConnection()->beginTransaction();
    }
1251324
public function beginTransaction($immediately = false)
    {
        //Nested transaction calls pending transactions begin
        if (!empty($this->pendingTransactionBegin[$this->transLevel])) {
            $this->dbBeginTransaction();
        }
        $this->transLevel++;
        $this->transLevelRolledBack[$this->transLevel] = false;

        if ($immediately) {
            $this->dbBeginTransaction();
        } else {
            $this->pendingTransactionBegin[$this->transLevel] = true;
        }

        return $this;
    }
603724
public function beginTransaction()
    {
        // auto reconnect
        $this->connect();
        
        $this->isTransaction = true;
        $this->connection->autocommit(false);//关闭自动提交
        return ;
    }
564262
public function beginTransaction($withConsistentSnapshot = false, $readOnly = false)
    {
        $filesToBegin = array();
        foreach ($this->filesStack as $files) {
            foreach ($files as $filePath => $file) {
                /* @var $file TransactionalFile */

                $filesToBegin[$filePath] = $file;
            }
        }

        foreach ($filesToBegin as $filePath => $file) {
            /* @var $file TransactionalFile */

            $file->beginTransaction();
        }

        $this->createdFilepathsStack[] = array();
        $this->deletedFilepathsStack[] = array();
        $this->filesStack[] = array();
        $this->directoriesStack[] = array();
    }
1128849
public function beginTransaction()
    {
        $this->_connect();
        $q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION);
        $this->_beginTransaction();
        $this->_profiler->queryEnd($q);
        return $this;
    }
24431
public function startTrans()
    {
        $this->initConnect(true);
        if (!$this->linkID) {
            return false;
        }

        ++$this->transTimes;
        try {
            if (1 == $this->transTimes) {
                $this->linkID->beginTransaction();
            } elseif ($this->transTimes > 1 && $this->supportSavepoint()) {
                $this->linkID->exec(
                    $this->parseSavepoint('trans' . $this->transTimes)
                );
            }

        } catch (\PDOException $e) {
            if ($this->isBreak($e)) {
                return $this->close()->startTrans();
            }
            throw $e;
        } catch (\Exception $e) {
            if ($this->isBreak($e)) {
                return $this->close()->startTrans();
            }
            throw $e;
        }
        return null;
    }
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;
    }
490480
public static function beginTransaction()
    {
        if (static::inTransaction()) {
            throw new PDOException();
        }

        static::inTransaction(true);

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

        static::addTransaction($transaction);
    }
875321
@Override
	public void begin() throws TransactionManagementException {
		logger.entering(CLASSNAME, "begin");
		
		try {
			userTran.begin();
			logger.log(Level.FINE, "javax.transaction.Status: {0}", userTran.getStatus());
		} catch (NotSupportedException e) {
			throw new TransactionManagementException(e);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "begin");
	}