Google Cloud Datastore v1 API - Class TransactionOptions (4.4.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
NameDescription
otherTransactionOptions

Properties

ModeCase

public TransactionOptions.ModeOneofCase ModeCase { get; }
Property Value
TypeDescription
TransactionOptions.ModeOneofCase

ReadOnly

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

The transaction should only allow reads.

Property Value
TypeDescription
TransactionOptions.Types.ReadOnly

ReadWrite

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

The transaction should allow both reads and writes.

Property Value
TypeDescription
TransactionOptions.Types.ReadWrite

Methods

CreateForRetry(ByteString)

public static TransactionOptions CreateForRetry(ByteString previousTransactionId)

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

Parameter
NameDescription
previousTransactionIdByteString

The ID of the transaction being retried.

Returns
TypeDescription
TransactionOptions

A TransactionOptions for a transaction to retry.

CreateReadOnly()

public static TransactionOptions CreateReadOnly()

Creates options for a read-only transaction.

Returns
TypeDescription
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
TypeDescription
TransactionOptions

A TransactionOptions for a read-write transaction.