Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 4.0.3 (Neumann SR3)
-
Fix Version/s: 4.1 GA (2020.0.0), 4.0.5 (Neumann SR5)
-
Component/s: Repositories
-
Labels:None
Description
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