|
20 | 20 | class ReadWrite extends \Google\Model |
21 | 21 | { |
22 | 22 | /** |
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. |
32 | 28 | */ |
33 | 29 | public const READ_LOCK_MODE_READ_LOCK_MODE_UNSPECIFIED = 'READ_LOCK_MODE_UNSPECIFIED'; |
34 | 30 | /** |
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. |
37 | 38 | */ |
38 | 39 | public const READ_LOCK_MODE_PESSIMISTIC = 'PESSIMISTIC'; |
39 | 40 | /** |
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. |
44 | 47 | */ |
45 | 48 | public const READ_LOCK_MODE_OPTIMISTIC = 'OPTIMISTIC'; |
46 | 49 | /** |
|
0 commit comments