Read-only transactions provide guaranteed consistency across several reads,
but do not allow writes. Read-only transactions can be configured to read at
timestamps in the past. Read-only transactions do not need to be committed and
do not take locks.
ReadWrite
Locking read-write transactions are the only transaction type that support writing
data into Cloud Spanner. These transactions rely on pessimistic locking and, if
necessary, two-phase commit. Locking read-write transactions may abort, requiring
the application to retry.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe webpage provides documentation for the \u003ccode\u003eTransactionMode\u003c/code\u003e enum within the \u003ccode\u003eGoogle.Cloud.Spanner.Data\u003c/code\u003e namespace, specifically showcasing various versions of the Google Cloud Spanner Data library.\u003c/p\u003e\n"],["\u003cp\u003eThe latest beta version of the library documented is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, while the most recent stable release documented is \u003ccode\u003e4.6.0\u003c/code\u003e, alongside many older versions going as far back as \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTransactionMode\u003c/code\u003e enum has two fields: \u003ccode\u003eReadOnly\u003c/code\u003e, which supports consistent reads but not writes and \u003ccode\u003eReadWrite\u003c/code\u003e, which supports writing data into Cloud Spanner but may abort and require retries.\u003c/p\u003e\n"],["\u003cp\u003eVersion \u003ccode\u003e4.1.0\u003c/code\u003e of the Google.Cloud.Spanner.Data library is listed, with links provided for all other versions from \u003ccode\u003e3.5.0\u003c/code\u003e up to \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, to view their relevant documentation.\u003c/p\u003e\n"]]],[],null,[]]