Stay organized with collections
Save and categorize content based on your preferences.
Rolls back a transaction, releasing any locks it holds. It's a good idea
to call this for any transaction that includes one or more Read or
ExecuteSql requests and ultimately decides not to commit. Rollback
returns OK if it successfully aborts the transaction, the transaction
was already aborted, or the transaction isn't found. Rollback never
returns ABORTED.
For more information about retries and long-running operations, see
Understand connectors.
Arguments
Parameters
session
string
Required. The session in which the transaction to roll back is running.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Method: googleapis.spanner.v1.projects.instances.databases.sessions.rollback\n\nRolls back a transaction, releasing any locks it holds. It's a good idea\nto call this for any transaction that includes one or more Read or\nExecuteSql requests and ultimately decides not to commit. `Rollback`\nreturns `OK` if it successfully aborts the transaction, the transaction\nwas already aborted, or the transaction isn't found. `Rollback` never\nreturns `ABORTED`.\n\nFor more information about retries and long-running operations, see\n[Understand connectors]().\n\nArguments\n---------\n\nRaised exceptions\n-----------------\n\nResponse\n--------\n\nIf successful, the response will be empty.\n\nSubworkflow snippet\n-------------------\n\nSome fields might be optional or required.\nTo identify required fields, refer to the [API documentation](https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances.databases.sessions/rollback). \n\n### YAML\n\n```yaml\n- rollback:\n call: googleapis.spanner.v1.projects.instances.databases.sessions.rollback\n args:\n session: ...\n body:\n transactionId: ...\n result: rollbackResult\n```\n\n### JSON\n\n```json\n[\n {\n \"rollback\": {\n \"call\": \"googleapis.spanner.v1.projects.instances.databases.sessions.rollback\",\n \"args\": {\n \"session\": \"...\",\n \"body\": {\n \"transactionId\": \"...\"\n }\n },\n \"result\": \"rollbackResult\"\n }\n }\n]\n```"]]