tags:

views:

55

answers:

1

I see two classes for locking in hibernate 1. LockOptions 2. LockMode

What is the difference between two? When to use each?

A: 

I don't have a definite answer but for MySQL the only way to generate a for update sql statement was:

query.setLockOptions(LockOptions.UPGRADE);
cherouvim
Are you sure? Or are you talking about this bug? http://stackoverflow.com/questions/3028478/how-to-specify-pessimistic-lock-with-criteria-api
Reddy
Yes, most probably it's the bug you mention. Thanks.
cherouvim