@@ -282,7 +282,8 @@ ApiFuture<Void> ensureTxnAsync() {
282282
283283 private void createTxnAsync (final SettableApiFuture <Void > res ) {
284284 span .addAnnotation ("Creating Transaction" );
285- final ApiFuture <ByteString > fut = session .beginTransactionAsync (options , isRouteToLeader ());
285+ final ApiFuture <ByteString > fut =
286+ session .beginTransactionAsync (options , isRouteToLeader (), getTransactionChannelHint ());
286287 fut .addListener (
287288 () -> {
288289 try {
@@ -427,7 +428,7 @@ public void run() {
427428 final ApiFuture <com .google .spanner .v1 .CommitResponse > commitFuture ;
428429 final ISpan opSpan = tracer .spanBuilderWithExplicitParent (SpannerImpl .COMMIT , span );
429430 try (IScope ignore = tracer .withSpan (opSpan )) {
430- commitFuture = rpc .commitAsync (commitRequest , session . getOptions ());
431+ commitFuture = rpc .commitAsync (commitRequest , getTransactionChannelHint ());
431432 }
432433 session .markUsed (clock .instant ());
433434 commitFuture .addListener (
@@ -525,7 +526,7 @@ ApiFuture<Empty> rollbackAsync() {
525526 .setSession (session .getName ())
526527 .setTransactionId (transactionId )
527528 .build (),
528- session . getOptions ());
529+ getTransactionChannelHint ());
529530 session .markUsed (clock .instant ());
530531 return apiFuture ;
531532 } else {
@@ -800,7 +801,7 @@ private ResultSet internalExecuteUpdate(
800801 statement , queryMode , options , /* withTransactionSelector = */ true );
801802 try {
802803 com .google .spanner .v1 .ResultSet resultSet =
803- rpc .executeQuery (builder .build (), session . getOptions (), isRouteToLeader ());
804+ rpc .executeQuery (builder .build (), getTransactionChannelHint (), isRouteToLeader ());
804805 session .markUsed (clock .instant ());
805806 if (resultSet .getMetadata ().hasTransaction ()) {
806807 onTransactionMetadata (
@@ -838,7 +839,8 @@ public ApiFuture<Long> executeUpdateAsync(Statement statement, UpdateOption... u
838839 // commit.
839840 increaseAsyncOperations ();
840841 resultSet =
841- rpc .executeQueryAsync (builder .build (), session .getOptions (), isRouteToLeader ());
842+ rpc .executeQueryAsync (
843+ builder .build (), getTransactionChannelHint (), isRouteToLeader ());
842844 session .markUsed (clock .instant ());
843845 } catch (Throwable t ) {
844846 decreaseAsyncOperations ();
@@ -926,7 +928,7 @@ public long[] batchUpdate(Iterable<Statement> statements, UpdateOption... update
926928 getExecuteBatchDmlRequestBuilder (statements , options );
927929 try {
928930 com .google .spanner .v1 .ExecuteBatchDmlResponse response =
929- rpc .executeBatchDml (builder .build (), session . getOptions ());
931+ rpc .executeBatchDml (builder .build (), getTransactionChannelHint ());
930932 session .markUsed (clock .instant ());
931933 long [] results = new long [response .getResultSetsCount ()];
932934 for (int i = 0 ; i < response .getResultSetsCount (); ++i ) {
@@ -983,7 +985,7 @@ public ApiFuture<long[]> batchUpdateAsync(
983985 // Register the update as an async operation that must finish before the transaction may
984986 // commit.
985987 increaseAsyncOperations ();
986- response = rpc .executeBatchDmlAsync (builder .build (), session . getOptions ());
988+ response = rpc .executeBatchDmlAsync (builder .build (), getTransactionChannelHint ());
987989 session .markUsed (clock .instant ());
988990 } catch (Throwable t ) {
989991 decreaseAsyncOperations ();
0 commit comments