Skip to content

Commit 02c4296

Browse files
chore: generate libraries at Wed Sep 3 15:24:37 UTC 2025
1 parent c47819b commit 02c4296

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -457,20 +457,28 @@ public class ConnectionProperties {
457457
static final ConnectionProperty<ReadLockMode> READ_LOCK_MODE =
458458
create(
459459
"read_lock_mode",
460-
"This option controls the locking behavior for read operations and queries within a read/write transaction. "
461-
+ "It works in conjunction with the transaction's isolation level.\n\n"
462-
+ "PESSIMISTIC: Read locks are acquired immediately on read. This mode only applies to SERIALIZABLE isolation. "
463-
+ "This mode prevents concurrent modifications by locking data throughout the transaction. This reduces commit-time "
464-
+ "aborts due to conflicts, but can increase how long transactions wait for locks and the overall contention.\n\n"
465-
+ "OPTIMISTIC: Locks for reads within the transaction are not acquired on read. Instead, the locks are acquired on "
466-
+ "commit to validate that read/queried data has not changed since the transaction started. If a conflict is "
467-
+ "detected, the transaction will fail. This mode only applies to SERIALIZABLE isolation. This mode defers locking "
468-
+ "until commit, which can reduce contention and improve throughput. However, be aware that this increases the "
469-
+ "risk of transaction aborts if there's significant write competition on the same data.\n\n"
470-
+ "READ_LOCK_MODE_UNSPECIFIED: This is the default if no mode is set. The locking behavior depends on the isolation level:\n\n"
471-
+ "REPEATABLE_READ: Locking semantics default to OPTIMISTIC. However, validation checks at commit are only "
472-
+ "performed for queries using SELECT FOR UPDATE, statements with {@code LOCK_SCANNED_RANGES} hints, and DML statements.\n\n"
473-
+ "For all other isolation levels: If the read lock mode is not set, it defaults to PESSIMISTIC locking.",
460+
"This option controls the locking behavior for read operations and queries within a"
461+
+ " read/write transaction. It works in conjunction with the transaction's isolation"
462+
+ " level.\n\n"
463+
+ "PESSIMISTIC: Read locks are acquired immediately on read. This mode only applies"
464+
+ " to SERIALIZABLE isolation. This mode prevents concurrent modifications by locking"
465+
+ " data throughout the transaction. This reduces commit-time aborts due to"
466+
+ " conflicts, but can increase how long transactions wait for locks and the overall"
467+
+ " contention.\n\n"
468+
+ "OPTIMISTIC: Locks for reads within the transaction are not acquired on read."
469+
+ " Instead, the locks are acquired on commit to validate that read/queried data has"
470+
+ " not changed since the transaction started. If a conflict is detected, the"
471+
+ " transaction will fail. This mode only applies to SERIALIZABLE isolation. This"
472+
+ " mode defers locking until commit, which can reduce contention and improve"
473+
+ " throughput. However, be aware that this increases the risk of transaction aborts"
474+
+ " if there's significant write competition on the same data.\n\n"
475+
+ "READ_LOCK_MODE_UNSPECIFIED: This is the default if no mode is set. The locking"
476+
+ " behavior depends on the isolation level:\n\n"
477+
+ "REPEATABLE_READ: Locking semantics default to OPTIMISTIC. However, validation"
478+
+ " checks at commit are only performed for queries using SELECT FOR UPDATE,"
479+
+ " statements with {@code LOCK_SCANNED_RANGES} hints, and DML statements.\n\n"
480+
+ "For all other isolation levels: If the read lock mode is not set, it defaults to"
481+
+ " PESSIMISTIC locking.",
474482
ReadLockMode.READ_LOCK_MODE_UNSPECIFIED,
475483
Arrays.stream(ReadLockMode.values())
476484
.filter(mode -> !mode.equals(ReadLockMode.UNRECOGNIZED))

0 commit comments

Comments
 (0)