Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ScanConsistency ignored for n1ql queries [DATACOUCH-605] #913

Closed
spring-projects-issues opened this issue Aug 19, 2020 · 4 comments
Closed

@ScanConsistency ignored for n1ql queries [DATACOUCH-605] #913

spring-projects-issues opened this issue Aug 19, 2020 · 4 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Aug 19, 2020

blitzenzzz opened DATACOUCH-605 and commented

A Repository shaped like this:

@Repository
public interface ThingRepo extends CouchbaseRepository<Thing, String> {
    @Query("#{#n1ql.selectEntity} WHERE #{#n1ql.filter} AND secondaryId = $secondaryId")
    @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
    Optional<Thing> getBySecondaryId(String secondaryId);
}

Will not attempt to look at the scan consistency annotation. It will also ignore it if you leave the annotation off and rely on the N1qlQueryCreator. See N1qlRepositoryQueryExecutor. The consistency will always be the default unbounded. The @WithConsistency annotation is also ignored.

I found this while migrating from 3.x to 4.0.3 and executing unit tests that use "save" to persist an entity and then call something similar to "getBySecondaryId" on the following line.

Documentation reference - https://docs.spring.io/spring-data/couchbase/docs/current/reference/html/#couchbase.repository.consistency


Affects: 4.0.3 (Neumann SR3)

Backported to: 4.0.5 (Neumann SR5)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 19, 2020

blitzenzzz commented

This bug is similar to https://jira.spring.io/browse/DATACOUCH-585, but not identical

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 19, 2020

Michael Reiche commented

I believe this is fixed with DATACOUCH-588, but this hasn't been merged yet.

#249

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 20, 2020

blitzenzzz commented

I see the change to ExecutableFindByQueryOperationSupport. I think those five lines would fix it

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 4, 2020

Michael Reiche commented

This is the pull-request for the fix that was eventually merged -

#267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.