Starts a transaction in the connection

@return void
@throws \ManaPHP\Db\Exception
774478
public function begin()
    {
        $context = $this->_context;

        $this->logger->info('transaction begin', 'db.transaction.begin');

        if ($context->transaction_level === 0) {
            $this->eventsManager->fireEvent('db:beginTransaction', $this);

            try {
                $connection = $this->poolManager->pop($this, $this->_timeout);

                if (!$connection->beginTransaction()) {
                    throw new DbException('beginTransaction failed.');
                }
                $context->connection = $connection;
            } catch (\PDOException $exception) {
                throw new DbException('beginTransaction failed: ' . $exception->getMessage(), $exception->getCode(), $exception);
            } finally {
                if (!$context->connection) {
                    $this->poolManager->push($this, $context);
                }
            }
        }

        $context->transaction_level++;
    }
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;
	}
857720
public function beginTransaction()
    {
        try {
            $this->connection->beginTransaction();
        } catch (DBALException $e) {
            throw new QueryException($e->getMessage(), $e->getCode(), $e);
        }
    }
487381
public function startTransaction(): bool {
        if ($this->transactionExists) {
            return false;
        }
        $started = $this->pdo->beginTransaction();
        $this->transactionExists = $started;
        return $started;
    }
981950
public function transactionStart($asSavepoint = false)
	{
		$this->connect();

		if (!$asSavepoint || !$this->transactionDepth)
		{
			$this->connection->beginTransaction();
		}

		$this->transactionDepth++;
	}
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;
	}
759585
public function beginTransaction() {
		if ($this->transactionManager === null) {
			$this->performBeginTransaction();
			return;
		}
		
		if (!$this->transactionManager->hasOpenTransaction()) {
			$this->transactionManager->createTransaction();
		}
	}
723322
public function beginTransaction()
    {
        $return = true;
        if (!$this->nestedTransactionCount) {
            $return = $this->connection->beginTransaction();
            if ($this->useDebug) {
                $this->log('Begin transaction');
            }
            $this->isUncommitable = false;
        }
        $this->nestedTransactionCount++;

        return $return;
    }
1014293
public function start()
    {
        if (!$this->nested || !$this->depth) {
            $this->db->connect()->getConnection()->beginTransaction();
        }

        $this->depth++;

        return $this;
    }
737706
final public function begin()
    {
        if (!$this->pdo) {
            throw  new Exception('您还没有连接数据库', Exception::CODE_DATABASE_ERROR);
        }
        if ($this->_begintransaction) {
            throw new Exception("已经开启了一个事务，请勿重新开启", Exception::CODE_DATABASE_ERROR);
        }
        $this->pdo->beginTransaction();
        $this->_begintransaction = true;
        return $this;
    }
969917
public function start() {
        // Don't load db if we don't want it (redo in the future)
        if($this->config->exists('database')) {
            $this->db = new DB\Connection($this->config);
        }

        $this->router = new Router($this->klein, $this->config);
    }
364302
public function beginTransaction()
    {
        if ($this->disableTransactionHandling) {
            return;
        }

        if (null !== $this->session) {
            throw new \RuntimeException('Transaction already started');
        }
        $this->session = $this->mongoClient->startSession();
        $this->session->startTransaction([
            'readConcern' => new \MongoDB\Driver\ReadConcern('snapshot'),
            'writeConcern' => new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY),
        ]);
    }
740748
public function begin(): void
  {
    $ret = $this->mysqli->autocommit(false);
    if (!$ret) $this->mySqlError('mysqli::autocommit');
  }
816657
public void connect() throws Exception {
        if (connection != null && !connection.isConnected()) {
            connection.connect();
            transaction = connection.getModbusTransport().createTransaction();
            setTransaction(transaction);
        }
    }
612495
public function begin()
    {
        $this->current = $this->current instanceof Transaction
            ? $this->current->newTransaction()
            : new Transaction;
    }
1053929
public static function start()
  {
    if (is_null(self::$_transaction)) {
      $object = self::$_transaction = new self();
      $object->_stored = Config::getDataAdapter();
      
      Config::setDataAdapter($object);
      
      $result = true;
    } else {
      $result = false;
    }
    
    return $result;
  }
96566
public function startTransaction($which_connection='')
    {
        if ($which_connection == '') {
            $which_connection = $this->default_db;
        }

        return $this->connections[$which_connection]->BeginTrans();
    }