From 1db7fb95c050df4ceadfde715ce603e41294e7db Mon Sep 17 00:00:00 2001 From: Michael Reiche <48999328+mikereiche@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:09:31 -0800 Subject: [PATCH] Use scope and collection in transaction in findByQuery.count(). (#1868) Closes #1862. --- .../couchbase/core/ReactiveFindByQueryOperationSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/couchbase/core/ReactiveFindByQueryOperationSupport.java b/src/main/java/org/springframework/data/couchbase/core/ReactiveFindByQueryOperationSupport.java index dce7f09a..5d099aba 100644 --- a/src/main/java/org/springframework/data/couchbase/core/ReactiveFindByQueryOperationSupport.java +++ b/src/main/java/org/springframework/data/couchbase/core/ReactiveFindByQueryOperationSupport.java @@ -256,8 +256,9 @@ public class ReactiveFindByQueryOperationSupport implements ReactiveFindByQueryO : rs.query(statement, opts); } else { TransactionQueryOptions opts = buildTransactionOptions(pArgs.getOptions()); - return (AttemptContextReactiveAccessor.createReactiveTransactionAttemptContext(s.get().getCore(), - clientFactory.getCluster().environment().jsonSerializer())).query(statement, opts); + JsonSerializer jSer = clientFactory.getCluster().environment().jsonSerializer(); + return AttemptContextReactiveAccessor.createReactiveTransactionAttemptContext(s.get().getCore(), jSer) + .query(OptionsBuilder.queryContext(pArgs.getScope(), pArgs.getCollection(), rs.bucketName()) == null ? null : rs, statement, opts); } });