function beginTransaction(int $isolation = \Plasma\TransactionInterface::ISOLATION_COMMITTED): \React\Promise\PromiseInterface {
        if($this->goingAway) {
            return \React\Promise\reject((new \Plasma\Exception('Client is closing all connections')));
        }
        
        $connection = $this->getOptimalConnection();
        
        return $connection->beginTransaction($this, $isolation)->then(null, function (\Throwable $error) use (&$connection) {
            $this->checkinConnection($connection);
            throw $error;
        });
    }
function beginTransaction(int $isolation = \Plasma\TransactionInterface::ISOLATION_COMMITTED): \React\Promise\PromiseInterface {
        if($this->goingAway) {
            return \React\Promise\reject((new \Plasma\Exception('Client is closing all connections')));
        }
        
        $connection = $this->getOptimalConnection();
        
        return $connection->beginTransaction($this, $isolation)->then(null, function (\Throwable $error) use (&$connection) {
            $this->checkinConnection($connection);
            throw $error;
        });
    }
function beginTransaction ( int $ isolation = \ Plasma \ TransactionInterface :: ISOLATION_COMMITTED ) : \ React \ Promise \ PromiseInterface { if ( $ this -> goingAway ) { return \ React \ Promise \ reject ( ( new \ Plasma \ Exception ( 'Client is closing all connections' ) ) ) ; } $ connection = $ this -> getOptimalConnection ( ) ; return $ connection -> beginTransaction ( $ this , $ isolation ) -> then ( null , function ( \ Throwable $ error ) use ( & $ connection ) { $ this -> checkinConnection ( $ connection ) ; throw $ error ; } ) ; }
Begins a transaction. Resolves with a `Transaction` instance.

Checks out a connection until the transaction gets committed or rolled back. If the transaction goes out of scope
and thus deallocated, the `Transaction` must check the connection back into the client.

Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition language (DDL)
statement such as DROP TABLE or CREATE TABLE is issued within a transaction.
The implicit COMMIT will prevent you from rolling back any other changes within the transaction boundary.
@param int  $isolation  See the `TransactionInterface` constants.
@return \React\Promise\PromiseInterface
@throws \Plasma\Exception
@see \Plasma\Transaction
Begins a transaction . Resolves with a Transaction instance .