Method: projects.instances.databases.sessions.beginTransaction

Begins a new transaction. This step can often be skipped:, sessions.executeSql and sessions.commit can begin a new transaction as a side-effect.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. The session in which the transaction runs.

Authorization requires one or more of the following Google IAM permissions on the specified resource session:

  • spanner.databases.beginReadOnlyTransaction
  • spanner.databases.beginOrRollbackReadWriteTransaction

Request body

The request body contains data with the following structure:

JSON representation
  "options": {
    object (TransactionOptions)

object (TransactionOptions)

Required. Options for the new transaction.

Response body

If successful, the response body contains an instance of Transaction.

Authorization Scopes

Requires one of the following OAuth scopes:


For more information, see the Authentication Overview.

Try it!

Hai trovato utile questa pagina? Facci sapere cosa ne pensi:

Invia feedback per...

Cloud Spanner Documentation