Google Cloud Datastore v1 API - Class TransactionOptions (4.11.0)

public sealed class TransactionOptions : IMessage<TransactionOptions>, IEquatable<TransactionOptions>, IDeepCloneable<TransactionOptions>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Datastore v1 API class TransactionOptions.

Options for beginning a new transaction.

Transactions can be created explicitly with calls to [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction] or implicitly by setting [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] in read requests.

Inheritance

object > TransactionOptions

Namespace

Google.Cloud.Datastore.V1

Assembly

Google.Cloud.Datastore.V1.dll

Constructors

TransactionOptions()

public TransactionOptions()

TransactionOptions(TransactionOptions)

public TransactionOptions(TransactionOptions other)
Parameter
Name Description
other TransactionOptions

Properties

ModeCase

public TransactionOptions.ModeOneofCase ModeCase { get; }
Property Value
Type Description
TransactionOptionsModeOneofCase

ReadOnly

public TransactionOptions.Types.ReadOnly ReadOnly { get; set; }

The transaction should only allow reads.

Property Value
Type Description
TransactionOptionsTypesReadOnly

ReadWrite

public TransactionOptions.Types.ReadWrite ReadWrite { get; set; }

The transaction should allow both reads and writes.

Property Value
Type Description
TransactionOptionsTypesReadWrite

Methods

CreateForRetry(ByteString)

public static TransactionOptions CreateForRetry(ByteString previousTransactionId)

Creates options for a transaction that will retry a previous one, identified by previousTransactionId.

Parameter
Name Description
previousTransactionId ByteString

The ID of the transaction being retried.

Returns
Type Description
TransactionOptions

A TransactionOptions for a transaction to retry.

CreateReadOnly()

public static TransactionOptions CreateReadOnly()

Creates options for a read-only transaction.

Returns
Type Description
TransactionOptions

A TransactionOptions for a read-only transaction.

CreateReadWrite()

public static TransactionOptions CreateReadWrite()

Creates options for a read-write transaction. (This is equivalent to not specifying transaction options at all.)

Returns
Type Description
TransactionOptions

A TransactionOptions for a read-write transaction.