@@ -282,7 +282,8 @@ ApiFuture<Void> ensureTxnAsync() {
282
282
283
283
private void createTxnAsync (final SettableApiFuture <Void > res ) {
284
284
span .addAnnotation ("Creating Transaction" );
285
- final ApiFuture <ByteString > fut = session .beginTransactionAsync (options , isRouteToLeader ());
285
+ final ApiFuture <ByteString > fut =
286
+ session .beginTransactionAsync (options , isRouteToLeader (), getTransactionChannelHint ());
286
287
fut .addListener (
287
288
() -> {
288
289
try {
@@ -427,7 +428,7 @@ public void run() {
427
428
final ApiFuture <com .google .spanner .v1 .CommitResponse > commitFuture ;
428
429
final ISpan opSpan = tracer .spanBuilderWithExplicitParent (SpannerImpl .COMMIT , span );
429
430
try (IScope ignore = tracer .withSpan (opSpan )) {
430
- commitFuture = rpc .commitAsync (commitRequest , session . getOptions ());
431
+ commitFuture = rpc .commitAsync (commitRequest , getTransactionChannelHint ());
431
432
}
432
433
session .markUsed (clock .instant ());
433
434
commitFuture .addListener (
@@ -525,7 +526,7 @@ ApiFuture<Empty> rollbackAsync() {
525
526
.setSession (session .getName ())
526
527
.setTransactionId (transactionId )
527
528
.build (),
528
- session . getOptions ());
529
+ getTransactionChannelHint ());
529
530
session .markUsed (clock .instant ());
530
531
return apiFuture ;
531
532
} else {
@@ -800,7 +801,7 @@ private ResultSet internalExecuteUpdate(
800
801
statement , queryMode , options , /* withTransactionSelector = */ true );
801
802
try {
802
803
com .google .spanner .v1 .ResultSet resultSet =
803
- rpc .executeQuery (builder .build (), session . getOptions (), isRouteToLeader ());
804
+ rpc .executeQuery (builder .build (), getTransactionChannelHint (), isRouteToLeader ());
804
805
session .markUsed (clock .instant ());
805
806
if (resultSet .getMetadata ().hasTransaction ()) {
806
807
onTransactionMetadata (
@@ -838,7 +839,8 @@ public ApiFuture<Long> executeUpdateAsync(Statement statement, UpdateOption... u
838
839
// commit.
839
840
increaseAsyncOperations ();
840
841
resultSet =
841
- rpc .executeQueryAsync (builder .build (), session .getOptions (), isRouteToLeader ());
842
+ rpc .executeQueryAsync (
843
+ builder .build (), getTransactionChannelHint (), isRouteToLeader ());
842
844
session .markUsed (clock .instant ());
843
845
} catch (Throwable t ) {
844
846
decreaseAsyncOperations ();
@@ -926,7 +928,7 @@ public long[] batchUpdate(Iterable<Statement> statements, UpdateOption... update
926
928
getExecuteBatchDmlRequestBuilder (statements , options );
927
929
try {
928
930
com .google .spanner .v1 .ExecuteBatchDmlResponse response =
929
- rpc .executeBatchDml (builder .build (), session . getOptions ());
931
+ rpc .executeBatchDml (builder .build (), getTransactionChannelHint ());
930
932
session .markUsed (clock .instant ());
931
933
long [] results = new long [response .getResultSetsCount ()];
932
934
for (int i = 0 ; i < response .getResultSetsCount (); ++i ) {
@@ -983,7 +985,7 @@ public ApiFuture<long[]> batchUpdateAsync(
983
985
// Register the update as an async operation that must finish before the transaction may
984
986
// commit.
985
987
increaseAsyncOperations ();
986
- response = rpc .executeBatchDmlAsync (builder .build (), session . getOptions ());
988
+ response = rpc .executeBatchDmlAsync (builder .build (), getTransactionChannelHint ());
987
989
session .markUsed (clock .instant ());
988
990
} catch (Throwable t ) {
989
991
decreaseAsyncOperations ();
0 commit comments