setLockMode does not work for Criteria in 4.2.15.Final version
Description
Activity

Christian Beikov April 8, 2022 at 5:07 PM
This issue will be rejected since the Hibernate legacy Criteria API was deprecated in 5.x and removed in 6.0. There will be no further development for it.
Steve Ebersole October 28, 2015 at 3:25 AM
As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.
Steve Ebersole October 27, 2015 at 7:14 PM
This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.
For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Ram G Suri November 10, 2014 at 6:16 PM
Test Case is as follows :
This is the code that we are using :
Criteria fetchDsceDerivedDataCriteria = sess.createCriteria(TestBO.class);
fetchDsceDerivedDataCriteria.setProjection(projList)
.add(Restrictions.eq("status" ,"RFS"))
.setResultTransformer(Transformers.aliasToBean(TestBO.class));
fetchDsceDerivedDataCriteria.setLockMode(LockMode.PESSIMISTIC_WRITE);
return fetchDsceDerivedDataCriteria;status
whereas TestBO.java is a DBEntity having property status and its getter and setter and some other properties.

Brett Meyer November 4, 2014 at 7:25 PM
Please attach a test case that demonstrates what you're seeing
Hi,
I am not able to use Criteria.setLockMode with PESSIMISTIC_WRITE lock .
Seems it does not lock using database lock.
Regards
Ram