Class TransactionOptions.Builder (6.98.0)

public static final class TransactionOptions.Builder extends GeneratedMessageV3.Builder<TransactionOptions.Builder> implements TransactionOptionsOrBuilder

Options to use for transactions.

Protobuf type google.spanner.v1.TransactionOptions

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TransactionOptions.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TransactionOptions.Builder
Overrides

build()

public TransactionOptions build()
Returns
Type Description
TransactionOptions

buildPartial()

public TransactionOptions buildPartial()
Returns
Type Description
TransactionOptions

clear()

public TransactionOptions.Builder clear()
Returns
Type Description
TransactionOptions.Builder
Overrides

clearExcludeTxnFromChangeStreams()

public TransactionOptions.Builder clearExcludeTxnFromChangeStreams()

When exclude_txn_from_change_streams is set to true, it prevents read or write transactions from being tracked in change streams.

  • If the DDL option allow_txn_exclusion is set to true, then the updates made within this transaction aren't recorded in the change stream.

  • If you don't set the DDL option allow_txn_exclusion or if it's set to false, then the updates made within this transaction are recorded in the change stream.

    When exclude_txn_from_change_streams is set to false or not set, modifications from this transaction are recorded in all change streams that are tracking columns modified by these transactions.

    The exclude_txn_from_change_streams option can only be specified for read-write or partitioned DML transactions, otherwise the API returns an INVALID_ARGUMENT error.

bool exclude_txn_from_change_streams = 5;

Returns
Type Description
TransactionOptions.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public TransactionOptions.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
TransactionOptions.Builder
Overrides

clearIsolationLevel()

public TransactionOptions.Builder clearIsolationLevel()

Isolation level for the transaction.

.google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;

Returns
Type Description
TransactionOptions.Builder

This builder for chaining.

clearMode()

public TransactionOptions.Builder clearMode()
Returns
Type Description
TransactionOptions.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public TransactionOptions.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
TransactionOptions.Builder
Overrides

clearPartitionedDml()

public TransactionOptions.Builder clearPartitionedDml()

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Returns
Type Description
TransactionOptions.Builder

clearReadOnly()

public TransactionOptions.Builder clearReadOnly()

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Returns
Type Description
TransactionOptions.Builder

clearReadWrite()

public TransactionOptions.Builder clearReadWrite()

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Returns
Type Description
TransactionOptions.Builder

clone()

public TransactionOptions.Builder clone()
Returns
Type Description
TransactionOptions.Builder
Overrides

getDefaultInstanceForType()

public TransactionOptions getDefaultInstanceForType()
Returns
Type Description
TransactionOptions

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getExcludeTxnFromChangeStreams()

public boolean getExcludeTxnFromChangeStreams()

When exclude_txn_from_change_streams is set to true, it prevents read or write transactions from being tracked in change streams.

  • If the DDL option allow_txn_exclusion is set to true, then the updates made within this transaction aren't recorded in the change stream.

  • If you don't set the DDL option allow_txn_exclusion or if it's set to false, then the updates made within this transaction are recorded in the change stream.

    When exclude_txn_from_change_streams is set to false or not set, modifications from this transaction are recorded in all change streams that are tracking columns modified by these transactions.

    The exclude_txn_from_change_streams option can only be specified for read-write or partitioned DML transactions, otherwise the API returns an INVALID_ARGUMENT error.

bool exclude_txn_from_change_streams = 5;

Returns
Type Description
boolean

The excludeTxnFromChangeStreams.

getIsolationLevel()

public TransactionOptions.IsolationLevel getIsolationLevel()

Isolation level for the transaction.

.google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;

Returns
Type Description
TransactionOptions.IsolationLevel

The isolationLevel.

getIsolationLevelValue()

public int getIsolationLevelValue()

Isolation level for the transaction.

.google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;

Returns
Type Description
int

The enum numeric value on the wire for isolationLevel.

getModeCase()

public TransactionOptions.ModeCase getModeCase()
Returns
Type Description
TransactionOptions.ModeCase

getPartitionedDml()

public TransactionOptions.PartitionedDml getPartitionedDml()

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Returns
Type Description
TransactionOptions.PartitionedDml

The partitionedDml.

getPartitionedDmlBuilder()

public TransactionOptions.PartitionedDml.Builder getPartitionedDmlBuilder()

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Returns
Type Description
TransactionOptions.PartitionedDml.Builder

getPartitionedDmlOrBuilder()

public TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder()

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Returns
Type Description
TransactionOptions.PartitionedDmlOrBuilder

getReadOnly()

public TransactionOptions.ReadOnly getReadOnly()

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Returns
Type Description
TransactionOptions.ReadOnly

The readOnly.

getReadOnlyBuilder()

public TransactionOptions.ReadOnly.Builder getReadOnlyBuilder()

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Returns
Type Description
TransactionOptions.ReadOnly.Builder

getReadOnlyOrBuilder()

public TransactionOptions.ReadOnlyOrBuilder getReadOnlyOrBuilder()

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Returns
Type Description
TransactionOptions.ReadOnlyOrBuilder

getReadWrite()

public TransactionOptions.ReadWrite getReadWrite()

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Returns
Type Description
TransactionOptions.ReadWrite

The readWrite.

getReadWriteBuilder()

public TransactionOptions.ReadWrite.Builder getReadWriteBuilder()

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Returns
Type Description
TransactionOptions.ReadWrite.Builder

getReadWriteOrBuilder()

public TransactionOptions.ReadWriteOrBuilder getReadWriteOrBuilder()

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Returns
Type Description
TransactionOptions.ReadWriteOrBuilder

hasPartitionedDml()

public boolean hasPartitionedDml()

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Returns
Type Description
boolean

Whether the partitionedDml field is set.

hasReadOnly()

public boolean hasReadOnly()

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Returns
Type Description
boolean

Whether the readOnly field is set.

hasReadWrite()

public boolean hasReadWrite()

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Returns
Type Description
boolean

Whether the readWrite field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TransactionOptions.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TransactionOptions.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public TransactionOptions.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
TransactionOptions.Builder
Overrides

mergeFrom(TransactionOptions other)

public TransactionOptions.Builder mergeFrom(TransactionOptions other)
Parameter
Name Description
other TransactionOptions
Returns
Type Description
TransactionOptions.Builder

mergePartitionedDml(TransactionOptions.PartitionedDml value)

public TransactionOptions.Builder mergePartitionedDml(TransactionOptions.PartitionedDml value)

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Parameter
Name Description
value TransactionOptions.PartitionedDml
Returns
Type Description
TransactionOptions.Builder

mergeReadOnly(TransactionOptions.ReadOnly value)

public TransactionOptions.Builder mergeReadOnly(TransactionOptions.ReadOnly value)

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Parameter
Name Description
value TransactionOptions.ReadOnly
Returns
Type Description
TransactionOptions.Builder

mergeReadWrite(TransactionOptions.ReadWrite value)

public TransactionOptions.Builder mergeReadWrite(TransactionOptions.ReadWrite value)

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Parameter
Name Description
value TransactionOptions.ReadWrite
Returns
Type Description
TransactionOptions.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TransactionOptions.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TransactionOptions.Builder
Overrides

setExcludeTxnFromChangeStreams(boolean value)

public TransactionOptions.Builder setExcludeTxnFromChangeStreams(boolean value)

When exclude_txn_from_change_streams is set to true, it prevents read or write transactions from being tracked in change streams.

  • If the DDL option allow_txn_exclusion is set to true, then the updates made within this transaction aren't recorded in the change stream.

  • If you don't set the DDL option allow_txn_exclusion or if it's set to false, then the updates made within this transaction are recorded in the change stream.

    When exclude_txn_from_change_streams is set to false or not set, modifications from this transaction are recorded in all change streams that are tracking columns modified by these transactions.

    The exclude_txn_from_change_streams option can only be specified for read-write or partitioned DML transactions, otherwise the API returns an INVALID_ARGUMENT error.

bool exclude_txn_from_change_streams = 5;

Parameter
Name Description
value boolean

The excludeTxnFromChangeStreams to set.

Returns
Type Description
TransactionOptions.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public TransactionOptions.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TransactionOptions.Builder
Overrides

setIsolationLevel(TransactionOptions.IsolationLevel value)

public TransactionOptions.Builder setIsolationLevel(TransactionOptions.IsolationLevel value)

Isolation level for the transaction.

.google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;

Parameter
Name Description
value TransactionOptions.IsolationLevel

The isolationLevel to set.

Returns
Type Description
TransactionOptions.Builder

This builder for chaining.

setIsolationLevelValue(int value)

public TransactionOptions.Builder setIsolationLevelValue(int value)

Isolation level for the transaction.

.google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;

Parameter
Name Description
value int

The enum numeric value on the wire for isolationLevel to set.

Returns
Type Description
TransactionOptions.Builder

This builder for chaining.

setPartitionedDml(TransactionOptions.PartitionedDml value)

public TransactionOptions.Builder setPartitionedDml(TransactionOptions.PartitionedDml value)

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Parameter
Name Description
value TransactionOptions.PartitionedDml
Returns
Type Description
TransactionOptions.Builder

setPartitionedDml(TransactionOptions.PartitionedDml.Builder builderForValue)

public TransactionOptions.Builder setPartitionedDml(TransactionOptions.PartitionedDml.Builder builderForValue)

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires spanner.databases.beginPartitionedDmlTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;

Parameter
Name Description
builderForValue TransactionOptions.PartitionedDml.Builder
Returns
Type Description
TransactionOptions.Builder

setReadOnly(TransactionOptions.ReadOnly value)

public TransactionOptions.Builder setReadOnly(TransactionOptions.ReadOnly value)

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Parameter
Name Description
value TransactionOptions.ReadOnly
Returns
Type Description
TransactionOptions.Builder

setReadOnly(TransactionOptions.ReadOnly.Builder builderForValue)

public TransactionOptions.Builder setReadOnly(TransactionOptions.ReadOnly.Builder builderForValue)

Transaction does not write.

Authorization to begin a read-only transaction requires spanner.databases.beginReadOnlyTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;

Parameter
Name Description
builderForValue TransactionOptions.ReadOnly.Builder
Returns
Type Description
TransactionOptions.Builder

setReadWrite(TransactionOptions.ReadWrite value)

public TransactionOptions.Builder setReadWrite(TransactionOptions.ReadWrite value)

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Parameter
Name Description
value TransactionOptions.ReadWrite
Returns
Type Description
TransactionOptions.Builder

setReadWrite(TransactionOptions.ReadWrite.Builder builderForValue)

public TransactionOptions.Builder setReadWrite(TransactionOptions.ReadWrite.Builder builderForValue)

Transaction may write.

Authorization to begin a read-write transaction requires spanner.databases.beginOrRollbackReadWriteTransaction permission on the session resource.

.google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;

Parameter
Name Description
builderForValue TransactionOptions.ReadWrite.Builder
Returns
Type Description
TransactionOptions.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public TransactionOptions.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
TransactionOptions.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final TransactionOptions.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TransactionOptions.Builder
Overrides