File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ public void removeListener(Runnable listener) {
219219
220220 private CommitResponse commitResponse ;
221221 private final Clock clock ;
222+ private boolean mutationsOnly = false ;
222223
223224 private final Map <SpannerRpc .Option , ?> channelHint ;
224225
@@ -402,6 +403,7 @@ ApiFuture<CommitResponse> commitAsync() {
402403 synchronized (lock ) {
403404 if (transactionIdFuture == null && transactionId == null && runningAsyncOperations == 0 ) {
404405 finishOps = SettableApiFuture .create ();
406+ mutationsOnly = true ;
405407 createTxnAsync (finishOps , randomMutation );
406408 } else {
407409 finishOps = finishedAsyncOperations ;
@@ -1229,7 +1231,7 @@ private <T> T runInternal(final TransactionCallable<T> txCallable) {
12291231 if (attempt .get () > 0 ) {
12301232 // Do not inline the BeginTransaction during a retry if the initial attempt did not
12311233 // actually start a transaction.
1232- useInlinedBegin = txn .transactionId != null ;
1234+ useInlinedBegin = txn .mutationsOnly || txn . transactionId != null ;
12331235
12341236 // Determine the latest transactionId when using a multiplexed session.
12351237 ByteString multiplexedSessionPreviousTransactionId = ByteString .EMPTY ;
You can’t perform that action at this time.
0 commit comments