Class Transaction (6.83.0)

public final class Transaction extends GeneratedMessageV3 implements TransactionOrBuilder

A transaction.

Protobuf type google.spanner.v1.Transaction

Static Fields

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

PRECOMMIT_TOKEN_FIELD_NUMBER

public static final int PRECOMMIT_TOKEN_FIELD_NUMBER
Field Value
Type Description
int

READ_TIMESTAMP_FIELD_NUMBER

public static final int READ_TIMESTAMP_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Transaction getDefaultInstance()
Returns
Type Description
Transaction

getDescriptor()

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

newBuilder()

public static Transaction.Builder newBuilder()
Returns
Type Description
Transaction.Builder

newBuilder(Transaction prototype)

public static Transaction.Builder newBuilder(Transaction prototype)
Parameter
Name Description
prototype Transaction
Returns
Type Description
Transaction.Builder

parseDelimitedFrom(InputStream input)

public static Transaction parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Transaction
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Transaction parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Transaction
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Transaction parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Transaction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Transaction parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Transaction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Transaction parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Transaction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Transaction parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Transaction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Transaction parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Transaction
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Transaction parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Transaction
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Transaction parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Transaction
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Transaction parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Transaction
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Transaction parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Transaction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Transaction parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Transaction
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Transaction> parser()
Returns
Type Description
Parser<Transaction>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Transaction getDefaultInstanceForType()
Returns
Type Description
Transaction

getId()

public ByteString getId()

id may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or Rollback calls.

Single-use read-only transactions do not have IDs, because single-use transactions do not support multiple requests.

bytes id = 1;

Returns
Type Description
ByteString

The id.

getParserForType()

public Parser<Transaction> getParserForType()
Returns
Type Description
Parser<Transaction>
Overrides

getPrecommitToken()

public MultiplexedSessionPrecommitToken getPrecommitToken()

A precommit token will be included in the response of a BeginTransaction request if the read-write transaction is on a multiplexed session and a mutation_key was specified in the BeginTransaction. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3;

Returns
Type Description
MultiplexedSessionPrecommitToken

The precommitToken.

getPrecommitTokenOrBuilder()

public MultiplexedSessionPrecommitTokenOrBuilder getPrecommitTokenOrBuilder()

A precommit token will be included in the response of a BeginTransaction request if the read-write transaction is on a multiplexed session and a mutation_key was specified in the BeginTransaction. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3;

Returns
Type Description
MultiplexedSessionPrecommitTokenOrBuilder

getReadTimestamp()

public Timestamp getReadTimestamp()

For snapshot read-only transactions, the read timestamp chosen for the transaction. Not returned by default: see TransactionOptions.ReadOnly.return_read_timestamp.

A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

.google.protobuf.Timestamp read_timestamp = 2;

Returns
Type Description
Timestamp

The readTimestamp.

getReadTimestampOrBuilder()

public TimestampOrBuilder getReadTimestampOrBuilder()

For snapshot read-only transactions, the read timestamp chosen for the transaction. Not returned by default: see TransactionOptions.ReadOnly.return_read_timestamp.

A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

.google.protobuf.Timestamp read_timestamp = 2;

Returns
Type Description
TimestampOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasPrecommitToken()

public boolean hasPrecommitToken()

A precommit token will be included in the response of a BeginTransaction request if the read-write transaction is on a multiplexed session and a mutation_key was specified in the BeginTransaction. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3;

Returns
Type Description
boolean

Whether the precommitToken field is set.

hasReadTimestamp()

public boolean hasReadTimestamp()

For snapshot read-only transactions, the read timestamp chosen for the transaction. Not returned by default: see TransactionOptions.ReadOnly.return_read_timestamp.

A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

.google.protobuf.Timestamp read_timestamp = 2;

Returns
Type Description
boolean

Whether the readTimestamp field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Transaction.Builder newBuilderForType()
Returns
Type Description
Transaction.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Transaction.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Transaction.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Transaction.Builder toBuilder()
Returns
Type Description
Transaction.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException