n our case we have a huge amount of logging exactly due to a query like the one below. The shouldBeLocked parameter is false in 99.99% of the cases, yet we create a Query with LockMode.NONE and we get 2 warnings in the logs HHH000445 and HHH000444 .
Query query = getCurrentSession().createQuery("from SomeEntity cr where contractIdentification = :contractIdentification"); query.setParameter("contractIdentification", contractIdentification); query.setLockMode("cr", shouldBeLocked ? LockMode.PESSIMISTIC_WRITE : LockMode.NONE); return query.list();