@@ -19,6 +19,7 @@ package google.spanner.v1;
1919import "google/api/field_behavior.proto" ;
2020import "google/protobuf/duration.proto" ;
2121import "google/protobuf/timestamp.proto" ;
22+ import "google/spanner/v1/location.proto" ;
2223
2324option csharp_namespace = "Google.Cloud.Spanner.V1" ;
2425option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb" ;
@@ -39,35 +40,46 @@ message TransactionOptions {
3940 // Default value.
4041 //
4142 // * If isolation level is
43+ // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE],
44+ // locking semantics default to `PESSIMISTIC`.
45+ // * If isolation level is
4246 // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ],
43- // then it is an error to specify `read_lock_mode`. Locking semantics
44- // default to `OPTIMISTIC`. No validation checks are done for reads,
45- // except to validate that the data that was served at the snapshot time
46- // is unchanged at commit time in the following cases:
47- // 1. reads done as part of queries that use `SELECT FOR UPDATE`
48- // 2. reads done as part of statements with a `LOCK_SCANNED_RANGES`
49- // hint
50- // 3. reads done as part of DML statements
51- // * At all other isolation levels, if `read_lock_mode` is the default
52- // value, then pessimistic read locks are used.
47+ // locking semantics default to `OPTIMISTIC`.
48+ // * See
49+ // [Concurrency
50+ // control](https://cloud.google.com/spanner/docs/concurrency-control)
51+ // for more details.
5352 READ_LOCK_MODE_UNSPECIFIED = 0 ;
5453
5554 // Pessimistic lock mode.
5655 //
57- // Read locks are acquired immediately on read.
58- // Semantics described only applies to
56+ // Lock acquisition behavior depends on the isolation level in use. In
5957 // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE]
60- // isolation.
58+ // isolation, reads and writes acquire necessary locks during transaction
59+ // statement execution. In
60+ // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ]
61+ // isolation, reads that explicitly request to be locked and writes
62+ // acquire locks.
63+ // See
64+ // [Concurrency
65+ // control](https://cloud.google.com/spanner/docs/concurrency-control) for
66+ // details on the types of locks acquired at each transaction step.
6167 PESSIMISTIC = 1 ;
6268
6369 // Optimistic lock mode.
6470 //
65- // Locks for reads within the transaction are not acquired on read.
66- // Instead the locks are acquired on a commit to validate that
67- // read/queried data has not changed since the transaction started.
68- // Semantics described only applies to
71+ // Lock acquisition behavior depends on the isolation level in use. In
72+ // both
6973 // [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE]
70- // isolation.
74+ // and
75+ // [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ]
76+ // isolation, reads and writes do not acquire locks during transaction
77+ // statement execution.
78+ // See
79+ // [Concurrency
80+ // control](https://cloud.google.com/spanner/docs/concurrency-control) for
81+ // details on how the guarantees of each isolation level are provided at
82+ // commit time.
7183 OPTIMISTIC = 2 ;
7284 }
7385
@@ -264,6 +276,14 @@ message Transaction {
264276 // attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit]
265277 // request for this transaction.
266278 MultiplexedSessionPrecommitToken precommit_token = 3 ;
279+
280+ // Optional. A cache update expresses a set of changes the client should
281+ // incorporate into its location cache. The client should discard the changes
282+ // if they are older than the data it already has. This data can be obtained
283+ // in response to requests that included a `RoutingHint` field, but may also
284+ // be obtained by explicit location-fetching RPCs which may be added in the
285+ // future.
286+ CacheUpdate cache_update = 5 [(google.api.field_behavior ) = OPTIONAL ];
267287}
268288
269289// This message is used to select the transaction in which a
0 commit comments