Options to use for transactions.
JSON representation |
---|
{ "excludeTxnFromChangeStreams": boolean, // Union field |
Fields | |
---|---|
excludeTxnFromChangeStreams |
When
When The |
Union field mode . Required. The type of transaction. mode can be only one of the following: |
|
readWrite |
Transaction may write. Authorization to begin a read-write transaction requires |
partitionedDml |
Partitioned DML transaction. Authorization to begin a Partitioned DML transaction requires |
readOnly |
Transaction does not write. Authorization to begin a read-only transaction requires |
ReadWrite
Message type to initiate a read-write transaction. Currently this transaction type has no options.
JSON representation |
---|
{ "multiplexedSessionPreviousTransactionId": string } |
Fields | |
---|---|
multiplexedSessionPreviousTransactionId |
Optional. Clients should pass the transaction ID of the previous transaction attempt that was aborted if this transaction is being executed on a multiplexed session. A base64-encoded string. |
PartitionedDml
This type has no fields.
Message type to initiate a Partitioned DML transaction.
ReadOnly
Message type to initiate a read-only transaction.
JSON representation |
---|
{ "returnReadTimestamp": boolean, // Union field |
Fields | |
---|---|
returnReadTimestamp |
If true, the Cloud Spanner-selected read timestamp is included in the |
Union field timestamp_bound . How to choose the timestamp for the read-only transaction. timestamp_bound can be only one of the following: |
|
strong |
sessions.read at a timestamp where all previously committed transactions are visible. |
minReadTimestamp |
Executes all reads at a timestamp >= This is useful for requesting fresher data than some previous read, or data that is fresh enough to observe the effects of some previously committed transaction whose timestamp is known. Note that this option can only be used in single-use transactions. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
maxStaleness |
sessions.read data at a timestamp >= Useful for reading the freshest data available at a nearby replica, while bounding the possible staleness if the local replica has fallen behind. Note that this option can only be used in single-use transactions. A duration in seconds with up to nine fractional digits, ending with ' |
readTimestamp |
Executes all reads at the given timestamp. Unlike other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp always returns the same data. If the timestamp is in the future, the read is blocked until the specified timestamp, modulo the read's deadline. Useful for large scale consistent reads such as mapreduces, or for coordinating many reads against a consistent snapshot of the data. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
exactStaleness |
Executes all reads at a timestamp that is Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps. Useful for reading at nearby replicas without the distributed timestamp negotiation overhead of A duration in seconds with up to nine fractional digits, ending with ' |