grails-data-mapping
grails-data-mapping copied to clipboard
Query.Lock(boolean) ignores false
trafficstars
Task List
- [x] Steps to reproduce provided
- [ ] Stacktrace (if present) provided
- [ ] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
Steps to Reproduce
- Call
Query.lock(false) - Observe that it still locks
Expected Behaviour
If false is passed into the method it should set LockModeType.NONE.
Actual Behaviour
LockModeType.PESSIMISTIC_WRITE is always used.
Example Application
This is easy to verify by inspecting the short method: https://github.com/grails/grails-data-mapping/blob/ef1730a42bc515cfb96cf9175d81e344d8a08a61/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/Query.java#L137-L140