Class: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite
- 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
-
#multiplexed_session_previous_transaction_id ⇒ ::String
Optional.
-
#read_lock_mode ⇒ ::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode
Read lock mode for the transaction.
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.
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 |
# 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::REPEATABLE_READ REPEATABLE_READ}, # then it is an error to specify `read_lock_mode`. Locking semantics # default to `OPTIMISTIC`. No validation checks are done for reads, # except to validate that the data that was served at the snapshot time # is unchanged at commit time in the following cases: # 1. reads done as part of queries that use `SELECT FOR UPDATE` # 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` # hint # 3. reads done as part of DML statements # * At all other isolation levels, if `read_lock_mode` is the default # value, then pessimistic read locks are used. READ_LOCK_MODE_UNSPECIFIED = 0 # Pessimistic lock mode. # # Read locks are acquired immediately on read. # Semantics described only applies to # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} # isolation. PESSIMISTIC = 1 # Optimistic lock mode. # # Locks for reads within the transaction are not acquired on read. # Instead the locks are acquired on a commit to validate that # read/queried data has not changed since the transaction started. # Semantics described only applies to # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} # isolation. OPTIMISTIC = 2 end end |
#read_lock_mode ⇒ ::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode
Returns Read lock mode for the transaction.
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 |
# 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::REPEATABLE_READ REPEATABLE_READ}, # then it is an error to specify `read_lock_mode`. Locking semantics # default to `OPTIMISTIC`. No validation checks are done for reads, # except to validate that the data that was served at the snapshot time # is unchanged at commit time in the following cases: # 1. reads done as part of queries that use `SELECT FOR UPDATE` # 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` # hint # 3. reads done as part of DML statements # * At all other isolation levels, if `read_lock_mode` is the default # value, then pessimistic read locks are used. READ_LOCK_MODE_UNSPECIFIED = 0 # Pessimistic lock mode. # # Read locks are acquired immediately on read. # Semantics described only applies to # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} # isolation. PESSIMISTIC = 1 # Optimistic lock mode. # # Locks for reads within the transaction are not acquired on read. # Instead the locks are acquired on a commit to validate that # read/queried data has not changed since the transaction started. # Semantics described only applies to # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} # isolation. OPTIMISTIC = 2 end end |