Skip to content

Commit 3f9e5ec

Browse files
committed
chore(spanner): set precommit token in CommitRequest
1 parent a2aa260 commit 3f9e5ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ public void run() {
429429
}
430430
requestBuilder.setRequestOptions(requestOptionsBuilder.build());
431431
}
432+
if (session.getIsMultiplexed() && getLatestPrecommitToken() != null) {
433+
// Set the precommit token in the CommitRequest for multiplexed sessions.
434+
requestBuilder.setPrecommitToken(getLatestPrecommitToken());
435+
}
432436
final CommitRequest commitRequest = requestBuilder.build();
433437
span.addAnnotation("Starting Commit");
434438
final ApiFuture<com.google.spanner.v1.CommitResponse> commitFuture;

0 commit comments

Comments
 (0)