public final void rollback(SessionName session, ByteString transactionId) {

    RollbackRequest request =
        RollbackRequest.newBuilder()
            .setSession(session == null ? null : session.toString())
            .setTransactionId(transactionId)
            .build();
    rollback(request);
  }
public final void rollback ( SessionName session , ByteString transactionId ) { RollbackRequest request = RollbackRequest . newBuilder ( ) . setSession ( session == null ? null : session . toString ( ) ) . setTransactionId ( transactionId ) . build ( ) ; rollback ( request ) ; }
Rolls back a transaction, releasing any locks it holds. It is a good idea to call this for any
transaction that includes one or more [Read][google.spanner.v1.Spanner.Read] or
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately decides not to
commit.

<p>`Rollback` returns `OK` if it successfully aborts the transaction, the transaction was
already aborted, or the transaction is not found. `Rollback` never returns `ABORTED`.

<p>Sample code:

<pre><code>
try (SpannerClient spannerClient = SpannerClient.create()) {
SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]");
ByteString transactionId = ByteString.copyFromUtf8("");
spannerClient.rollback(session, transactionId);
}
</code></pre>

@param session Required. The session in which the transaction to roll back is running.
@param transactionId Required. The transaction to roll back.
@throws com.google.api.gax.rpc.ApiException if the remote call fails