Send feedback
Class TransactionOptions (6.98.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latestkeyboard_arrow_down
public final class TransactionOptions extends GeneratedMessageV3 implements TransactionOptionsOrBuilder
Options to use for transactions.
Protobuf type google.spanner.v1.TransactionOptions
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
EXCLUDE_TXN_FROM_CHANGE_STREAMS_FIELD_NUMBER
public static final int EXCLUDE_TXN_FROM_CHANGE_STREAMS_FIELD_NUMBER
Field Value
Type
Description
int
ISOLATION_LEVEL_FIELD_NUMBER
public static final int ISOLATION_LEVEL_FIELD_NUMBER
Field Value
Type
Description
int
PARTITIONED_DML_FIELD_NUMBER
public static final int PARTITIONED_DML_FIELD_NUMBER
Field Value
Type
Description
int
READ_ONLY_FIELD_NUMBER
public static final int READ_ONLY_FIELD_NUMBER
Field Value
Type
Description
int
READ_WRITE_FIELD_NUMBER
public static final int READ_WRITE_FIELD_NUMBER
Field Value
Type
Description
int
Static Methods
getDefaultInstance()
public static TransactionOptions getDefaultInstance ()
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
newBuilder()
public static TransactionOptions . Builder newBuilder ()
newBuilder(TransactionOptions prototype)
public static TransactionOptions . Builder newBuilder ( TransactionOptions prototype )
public static TransactionOptions parseDelimitedFrom ( InputStream input )
public static TransactionOptions parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(byte[] data)
public static TransactionOptions parseFrom ( byte [] data )
Parameter
Name
Description
data
byte []
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static TransactionOptions parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteString data)
public static TransactionOptions parseFrom ( ByteString data )
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static TransactionOptions parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
public static TransactionOptions parseFrom ( CodedInputStream input )
public static TransactionOptions parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
public static TransactionOptions parseFrom ( InputStream input )
public static TransactionOptions parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteBuffer data)
public static TransactionOptions parseFrom ( ByteBuffer data )
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static TransactionOptions parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
parser()
public static Parser<TransactionOptions> parser ()
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Name
Description
obj
Object
Overrides
getDefaultInstanceForType()
public TransactionOptions getDefaultInstanceForType ()
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;
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 ()
getParserForType()
public Parser<TransactionOptions> getParserForType ()
Overrides
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;
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;
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;
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;
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;
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;
getSerializedSize()
public int getSerializedSize ()
Returns
Type
Description
int
Overrides
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.
hashCode()
Returns
Type
Description
int
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
newBuilderForType()
public TransactionOptions . Builder newBuilderForType ()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected TransactionOptions . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Returns
Type
Description
Object
Overrides
toBuilder()
public TransactionOptions . Builder toBuilder ()
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-02 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-02 UTC."],[],[]]