public function commit(): Promise
    {
        if ($this->handle === null) {
            throw new TransactionError("The transaction has been committed or rolled back");
        }

        $promise = $this->handle->query("COMMIT");
        $this->handle = null;
        $promise->onResolve($this->release);

        return $promise;
    }
public function commit(): Promise
    {
        if ($this->handle === null) {
            throw new TransactionError("The transaction has been committed or rolled back");
        }

        $promise = $this->handle->query("COMMIT");
        $this->handle = null;
        $promise->onResolve($this->release);

        return $promise;
    }
public function commit ( ) : Promise { if ( $ this -> handle === null ) { throw new TransactionError ( "The transaction has been committed or rolled back" ) ; } $ promise = $ this -> handle -> query ( "COMMIT" ) ; $ this -> handle = null ; $ promise -> onResolve ( $ this -> release ) ; return $ promise ; }
Commits the transaction and makes it inactive.

@return Promise<\Amp\Sql\CommandResult>

@throws TransactionError If the transaction has been committed or rolled back.
Commits the transaction and makes it inactive .