Skip to content

Commit 089c171

Browse files
1 parent 2d85b76 commit 089c171

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

src/Spanner/ReadWrite.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,30 @@
2020
class ReadWrite extends \Google\Model
2121
{
2222
/**
23-
* Default value. * If isolation level is REPEATABLE_READ, then it is an error
24-
* to specify `read_lock_mode`. Locking semantics default to `OPTIMISTIC`. No
25-
* validation checks are done for reads, except to validate that the data that
26-
* was served at the snapshot time is unchanged at commit time in the
27-
* following cases: 1. reads done as part of queries that use `SELECT FOR
28-
* UPDATE` 2. reads done as part of statements with a `LOCK_SCANNED_RANGES`
29-
* hint 3. reads done as part of DML statements * At all other isolation
30-
* levels, if `read_lock_mode` is the default value, then pessimistic read
31-
* locks are used.
23+
* Default value. * If isolation level is SERIALIZABLE, locking semantics
24+
* default to `PESSIMISTIC`. * If isolation level is REPEATABLE_READ, locking
25+
* semantics default to `OPTIMISTIC`. * See [Concurrency
26+
* control](https://cloud.google.com/spanner/docs/concurrency-control) for
27+
* more details.
3228
*/
3329
public const READ_LOCK_MODE_READ_LOCK_MODE_UNSPECIFIED = 'READ_LOCK_MODE_UNSPECIFIED';
3430
/**
35-
* Pessimistic lock mode. Read locks are acquired immediately on read.
36-
* Semantics described only applies to SERIALIZABLE isolation.
31+
* Pessimistic lock mode. Lock acquisition behavior depends on the isolation
32+
* level in use. In SERIALIZABLE isolation, reads and writes acquire necessary
33+
* locks during transaction statement execution. In REPEATABLE_READ isolation,
34+
* reads that explicitly request to be locked and writes acquire locks. See
35+
* [Concurrency control](https://cloud.google.com/spanner/docs/concurrency-
36+
* control) for details on the types of locks acquired at each transaction
37+
* step.
3738
*/
3839
public const READ_LOCK_MODE_PESSIMISTIC = 'PESSIMISTIC';
3940
/**
40-
* Optimistic lock mode. Locks for reads within the transaction are not
41-
* acquired on read. Instead the locks are acquired on a commit to validate
42-
* that read/queried data has not changed since the transaction started.
43-
* Semantics described only applies to SERIALIZABLE isolation.
41+
* Optimistic lock mode. Lock acquisition behavior depends on the isolation
42+
* level in use. In both SERIALIZABLE and REPEATABLE_READ isolation, reads and
43+
* writes do not acquire locks during transaction statement execution. See
44+
* [Concurrency control](https://cloud.google.com/spanner/docs/concurrency-
45+
* control) for details on how the guarantees of each isolation level are
46+
* provided at commit time.
4447
*/
4548
public const READ_LOCK_MODE_OPTIMISTIC = 'OPTIMISTIC';
4649
/**

0 commit comments

Comments
 (0)