Class: Google::Apis::SpannerV1::Transaction

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb

Overview

A transaction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Transaction

Returns a new instance of Transaction.



6748
6749
6750
# File 'lib/google/apis/spanner_v1/classes.rb', line 6748

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#idString

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. Corresponds to the JSON property id NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


6730
6731
6732
# File 'lib/google/apis/spanner_v1/classes.rb', line 6730

def id
  @id
end

#precommit_tokenGoogle::Apis::SpannerV1::MultiplexedSessionPrecommitToken

When a read-write transaction is executed on a multiplexed session, this precommit token is sent back to the client as a part of the Transaction message in the BeginTransaction response and also as a part of the ResultSet and PartialResultSet responses. Corresponds to the JSON property precommitToken



6738
6739
6740
# File 'lib/google/apis/spanner_v1/classes.rb', line 6738

def precommit_token
  @precommit_token
end

#read_timestampString

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". Corresponds to the JSON property readTimestamp

Returns:

  • (String)


6746
6747
6748
# File 'lib/google/apis/spanner_v1/classes.rb', line 6746

def read_timestamp
  @read_timestamp
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6753
6754
6755
6756
6757
# File 'lib/google/apis/spanner_v1/classes.rb', line 6753

def update!(**args)
  @id = args[:id] if args.key?(:id)
  @precommit_token = args[:precommit_token] if args.key?(:precommit_token)
  @read_timestamp = args[:read_timestamp] if args.key?(:read_timestamp)
end