Too aggressive pessimistic write lock in PostgreSQL

That’s a good observation.

There are two ways we can address this:

  1. We could add a Hibernate configuration property which will allow Hibernate to use NO KEYS when doing a PESSIMISTIC_READ or PESSIMISTIC_WRITE.
  2. We could add a new LockOptions.NO_KEYS for this.

I created the HHH-13135 Jira issue for this.