That’s a good observation.
There are two ways we can address this:
- We could add a Hibernate configuration property which will allow Hibernate to use
NO KEYS
when doing a PESSIMISTIC_READ or PESSIMISTIC_WRITE. - We could add a new
LockOptions.NO_KEYS
for this.
I created the HHH-13135 Jira issue for this.