Spring data and CouchbaseEnvironment

I’m using spring-data-couchbase (3.0.9.RELEASE) and something seems to me strange.

In couchbase documentation, they said " If statement_plus is used, mutation tokens need to be enabled in the environment" (https://docs.couchbase.com/java-sdk/2.7/scan-consistency-examples.html)

And by default, spring data couchbase uses statement_plus : https://docs.spring.io/spring-data/couchbase/docs/current/api/org/springframework/data/couchbase/core/query/Consistency.html

And the default CouchbaseEnvironnement is just : “DefaultCouchbaseEnvironment.create()”.
The mutationTokensEnabled is “false” by default.

What is the impact to use statement_plus with mutationTokensEnabled to false ?
Should I override CouchbaseEnvironnement to set mutationTokensEnabled to true if I want to use statement_plus ?

Hi @nicolaslaubert,

Yes, it seems to be a bug in Spring data couchbase, that it is incorrectly mapping READ_YOUR_OWN_WRITES to statement_plus instead of request_plus, as in code, but I believe both exhibit similar behavior when the mutation tokens aren’t passed along. Created a ticket here to track (PRs are welcome :))

What is the impact to use statement_plus with mutationTokensEnabled to false ? maybe performance improvement with mutationtokens enabled

1 Like