public sealed class AmbientTransactionOptions
Reference documentation and code samples for the Google.Cloud.Spanner.Data class AmbientTransactionOptions.
Options for a SpannerTransaction that is enlisted in Transaction.
Namespace
Google.Cloud.Spanner.DataAssembly
Google.Cloud.Spanner.Data.dll
Properties
CommitDelay
public TimeSpan? CommitDelay { get; }
The maximum amount of time the commit may be delayed server side for batching with other commits. The bigger the delay, the better the throughput (QPS), but at the expense of commit latency. If set to Zero, commit batching is disabled. May be null, in which case commits will continue to be batched as they had been before this configuration option was made available to Spanner API consumers. May be set to any value between Zero and 500ms.
Property Value | |
---|---|
Type | Description |
TimeSpan |
Default
public static AmbientTransactionOptions Default { get; }
Default options for an ambient transaction. Using these options will result in a read-write transaction with no CommitDelay value set.
Property Value | |
---|---|
Type | Description |
AmbientTransactionOptions |
TimestampBound
public TimestampBound TimestampBound { get; }
Timestamp bound settings for the ambient transaction. May be null. When set, the ambient transaction will be read-only. At most, one of TimestampBound and TransactionId may be set. If none of TimestampBound and TransactionId are set, the ambient transaction will be a read-write transaction.
Property Value | |
---|---|
Type | Description |
TimestampBound |
TransactionId
public TransactionId TransactionId { get; }
The transaction ID of an active read-only transaction to use for the ambient transaction. May be null. At most, one of TimestampBound and TransactionId may be set. If none of TimestampBound and TransactionId are set, the ambient transaction will be a read-write transaction.
Property Value | |
---|---|
Type | Description |
TransactionId |
Methods
ForTimestampBoundReadOnly(TimestampBound)
public static AmbientTransactionOptions ForTimestampBoundReadOnly(TimestampBound timestampBound = null)
Creates a new set of ambient transaction options with the given timestampBound
options.
Parameter | |
---|---|
Name | Description |
timestampBound | TimestampBound The timestamp bound options to be used for the ambient transaction. May be null, in which case Strong will be used. |
Returns | |
---|---|
Type | Description |
AmbientTransactionOptions |
FromReadOnlyTransactionId(TransactionId)
public static AmbientTransactionOptions FromReadOnlyTransactionId(TransactionId transactionId)
Creates a new set of ambient transaction options with the given transactionId
.
Parameter | |
---|---|
Name | Description |
transactionId | TransactionId The transaction ID to use for the ambient transaction. Must not be null. |
Returns | |
---|---|
Type | Description |
AmbientTransactionOptions |
WithCommitDelay(TimeSpan?)
public AmbientTransactionOptions WithCommitDelay(TimeSpan? commitDelay)
Returns a new set of options equal to these, except for the specified commitDelay
.
Parameter | |
---|---|
Name | Description |
commitDelay | TimeSpan |
Returns | |
---|---|
Type | Description |
AmbientTransactionOptions |