How do I get hibernate to generate Oracle's FOR UPDATE WAIT 10 syntax
问题 I have a line of code like this: final Foo foo = (Foo)session.get( Foo.class, id, LockMode.UPGRADE ); This generates a SELECT .. FOR UPDATE . However, I'm only willing to wait for 10 seconds to obtain the lock and there for I would like a SELECT .. FOR UPDATE WAIT 10 . How can I get hibernate to generate this? 回答1: The answer is to use the LockOptions class with SetTimeout() rather than LockMode. For this, we upgraded to Hibernate 3.6 only to find it is broken for Oracle. 回答2: AFAIK, you can