I’ve got the entity that contains @version field.
Sometimes I need to update it in spite of optimistic locking exception.
Can I turn it off somehow in that case? Or I should just reload entity and retry to save it n times until it updates?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can work directly agains the connection:
org.hibernate.Session.doWork(Work work).But you are incurring in last write wins. It is better to use transactions isolation levels to perform row lock. But the database must support them.
Hibernate 3.xhas theSession.connection()but in4it is gone.