Skip to content

Commit 8e91704

Browse files
authored
chore: update executor to fix a SI issue (#13492)
1 parent eb379b3 commit 8e91704

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

java-spanner/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,10 @@ public void startRWTransaction() throws Exception {
397397
} else {
398398
transactionOptions.add(Options.isolationLevel(IsolationLevel.SERIALIZABLE));
399399
}
400-
if (optimistic) {
400+
if (!repeatableRead && optimistic) {
401401
transactionOptions.add(Options.readLockMode(ReadLockMode.OPTIMISTIC));
402-
} else {
402+
}
403+
if (repeatableRead && !optimistic) {
403404
transactionOptions.add(Options.readLockMode(ReadLockMode.PESSIMISTIC));
404405
}
405406
runner =

0 commit comments

Comments
 (0)