Google.Cloud.Spanner.Data - Class AmbientTransactionOptions (5.0.0-beta02)

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.

Inheritance

object > AmbientTransactionOptions

Namespace

Google.Cloud.Spanner.Data

Assembly

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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
timestampBoundTimestampBound

The timestamp bound options to be used for the ambient transaction. May be null, in which case Strong will be used.

Returns
TypeDescription
AmbientTransactionOptions

FromReadOnlyTransactionId(TransactionId)

public static AmbientTransactionOptions FromReadOnlyTransactionId(TransactionId transactionId)

Creates a new set of ambient transaction options with the given transactionId.

Parameter
NameDescription
transactionIdTransactionId

The transaction ID to use for the ambient transaction. Must not be null.

Returns
TypeDescription
AmbientTransactionOptions

WithCommitDelay(TimeSpan?)

public AmbientTransactionOptions WithCommitDelay(TimeSpan? commitDelay)

Returns a new set of options equal to these, except for the specified commitDelay.

Parameter
NameDescription
commitDelayTimeSpan
Returns
TypeDescription
AmbientTransactionOptions