Class: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/spanner/v1/transaction.rb

Overview

Message type to initiate a read-write transaction. Currently this transaction type has no options.

Defined Under Namespace

Modules: ReadLockMode

Instance Attribute Summary collapse

Instance Attribute Details

#multiplexed_session_previous_transaction_id::String

Returns Optional. Clients should pass the transaction ID of the previous transaction attempt that was aborted if this transaction is being executed on a multiplexed session.

Returns:

  • (::String)

    Optional. Clients should pass the transaction ID of the previous transaction attempt that was aborted if this transaction is being executed on a multiplexed session.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'proto_docs/google/spanner/v1/transaction.rb', line 89

class ReadWrite
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # `ReadLockMode` is used to set the read lock mode for read-write
  # transactions.
  module ReadLockMode
    # Default value.
    #
    # * If isolation level is
    #   {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE},
    #   locking semantics default to `PESSIMISTIC`.
    # * If isolation level is
    #   {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ},
    #   locking semantics default to `OPTIMISTIC`.
    # * See
    #   [Concurrency
    #   control](https://cloud.google.com/spanner/docs/concurrency-control)
    #   for more details.
    READ_LOCK_MODE_UNSPECIFIED = 0

    # Pessimistic lock mode.
    #
    # Lock acquisition behavior depends on the isolation level in use. In
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}
    # isolation, reads and writes acquire necessary locks during transaction
    # statement execution. In
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}
    # isolation, reads that explicitly request to be locked and writes
    # acquire locks.
    # See
    # [Concurrency
    # control](https://cloud.google.com/spanner/docs/concurrency-control) for
    # details on the types of locks acquired at each transaction step.
    PESSIMISTIC = 1

    # Optimistic lock mode.
    #
    # Lock acquisition behavior depends on the isolation level in use. In
    # both
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}
    # and
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}
    # isolation, reads and writes do not acquire locks during transaction
    # statement execution.
    # See
    # [Concurrency
    # control](https://cloud.google.com/spanner/docs/concurrency-control) for
    # details on how the guarantees of each isolation level are provided at
    # commit time.
    OPTIMISTIC = 2
  end
end

#read_lock_mode::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode

Returns Read lock mode for the transaction.

Returns:



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'proto_docs/google/spanner/v1/transaction.rb', line 89

class ReadWrite
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # `ReadLockMode` is used to set the read lock mode for read-write
  # transactions.
  module ReadLockMode
    # Default value.
    #
    # * If isolation level is
    #   {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE},
    #   locking semantics default to `PESSIMISTIC`.
    # * If isolation level is
    #   {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ},
    #   locking semantics default to `OPTIMISTIC`.
    # * See
    #   [Concurrency
    #   control](https://cloud.google.com/spanner/docs/concurrency-control)
    #   for more details.
    READ_LOCK_MODE_UNSPECIFIED = 0

    # Pessimistic lock mode.
    #
    # Lock acquisition behavior depends on the isolation level in use. In
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}
    # isolation, reads and writes acquire necessary locks during transaction
    # statement execution. In
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}
    # isolation, reads that explicitly request to be locked and writes
    # acquire locks.
    # See
    # [Concurrency
    # control](https://cloud.google.com/spanner/docs/concurrency-control) for
    # details on the types of locks acquired at each transaction step.
    PESSIMISTIC = 1

    # Optimistic lock mode.
    #
    # Lock acquisition behavior depends on the isolation level in use. In
    # both
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}
    # and
    # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}
    # isolation, reads and writes do not acquire locks during transaction
    # statement execution.
    # See
    # [Concurrency
    # control](https://cloud.google.com/spanner/docs/concurrency-control) for
    # details on how the guarantees of each isolation level are provided at
    # commit time.
    OPTIMISTIC = 2
  end
end