Begin transaction on the db side
541713
private function dbBeginTransaction()
    {
        if ($this->pendingConnection) {
            $this->connect();
        }

        $this->pendingTransactionBegin[$this->transLevel] = false;

        if ($this->dbTransLevel == 0) {
            //Top level transaction
            $res = pg_query($this->pgConn, 'begin');
        } else {
            $res = pg_query(
                $this->pgConn,
                'savepoint level' . $this->dbTransLevel . 'begin'
            );
        }

        if ($res === false) {
            $this->cleanAfterCommit();
            throw $this->createException();
        }

        $this->dbTransLevel++;

        return $res;
    }
807236
public function startTransaction()
    {
        $this->db_connect('w', true);

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

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

        return $this->last_result = $this->dbh->beginTransaction();
    }
425981
public function transactionStart()
    {
        if (empty($this->oDb)) {
            $this->connect();
        }

        try {

            $this->oDb->beginTransaction();
            $this->transactionRunning = true;

            return true;

        } catch (\Exception $e) {
            throw new TransactionException($e->getMessage(), $e->getCode());
        }
    }
266711
@Override
	public AppEngineTransaction beginTransaction() {
		if (isTransactional()) {
			throw new IllegalStateException("Transaction has already started ["
					+ transaction.get().id() + "]");
		}
		
		transaction.set(new AppEngineGlobalTransaction(this));
		logger.fine("Transaction ["
				+ transaction.get().id()
				+ "] started");
		return transaction.get();
	}
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),
        ]);
    }
1260651
def perform_ops(self):
        
        with self.db:
            with closing(self.db.cursor()) as cursor:
                cursor.execute('BEGIN TRANSACTION')
                self._perform_ops(cursor)
908788
private function OpenTransaction(){
        if(!$this->transactionActive) {
            $this->beginTransaction();
            $this->exec("SET FOREIGN_KEY_CHECKS = 0;");
            $this->transactionActive = true;
        }
    }
1055842
public function startTrans() {
        $this->connect();
        $this->transTimes++;
        if (1 == $this->transTimes) {
            $this->pdo->beginTransaction();
        }
    }
1129724
def begin_pending_transactions(self):
        """"""
        while not self._pending_sessions.empty():
            session = self._pending_sessions.get()
            session._transaction.begin()
            super(TransactionPingingPool, self).put(session)
451245
def begin(self):
        
        conn = yield self._get_conn()
        try:
            yield conn.begin()
        except:
            self._close_conn(conn)
            raise
        trx = Transaction(self, conn)
        raise Return(trx)
490480
public static function beginTransaction()
    {
        if (static::inTransaction()) {
            throw new PDOException();
        }

        static::inTransaction(true);

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

        static::addTransaction($transaction);
    }
1326670
def begin(self):
        
        if self._transaction_id is not None:
            raise ValueError("Transaction already begun")

        if self.committed is not None:
            raise ValueError("Transaction already committed")

        if self._rolled_back:
            raise ValueError("Transaction is already rolled back")

        database = self._session._database
        api = database.spanner_api
        metadata = _metadata_with_prefix(database.name)
        txn_options = TransactionOptions(read_write=TransactionOptions.ReadWrite())
        response = api.begin_transaction(
            self._session.name, txn_options, metadata=metadata
        )
        self._transaction_id = response.id
        return self._transaction_id
759585
public function beginTransaction() {
		if ($this->transactionManager === null) {
			$this->performBeginTransaction();
			return;
		}
		
		if (!$this->transactionManager->hasOpenTransaction()) {
			$this->transactionManager->createTransaction();
		}
	}
896480
public function open(): Transaction
    {
        $response = ($this->fulfill)(
            new Request(
                Url::fromString('/db/data/transaction'),
                Method::post(),
                new ProtocolVersion(1, 1),
                $this->headers,
                $this->body
            )
        );

        $body = Json::decode((string) $response->body());
        $location = (string) $response
            ->headers()
            ->get('Location')
            ->values()
            ->current();
        $transaction = new Transaction(
            Url::fromString($location),
            $this->clock->at($body['transaction']['expires']),
            Url::fromString($body['commit'])
        );

        $this->transactions = $this->transactions->add($transaction);

        return $transaction;
    }
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;
	}
374374
def transaction
      transaction = database.create_transaction(transaction_code,
                                                write: write_collections,
                                                read:  read_collections)
      transaction.wait_for_sync = true

      transaction
    end
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);
    }