grails-data-mapping icon indicating copy to clipboard operation
grails-data-mapping copied to clipboard

Query.Lock(boolean) ignores false

Open ProTip opened this issue 5 years ago • 0 comments
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

  1. Call Query.lock(false)
  2. 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

ProTip avatar May 14 '20 16:05 ProTip