I am working on a project using Spring and Hibernate and Java 6.
We are using an MX/SQL relational database running on HP Nonstop. Client tests (and our tests) are showing occasional Error 73, meaning a database lock conflict. We believe that these conflicts are temporary, and that if the thread that hits this error waits and retries, instead of throwing an Exception right away, the conflict would soon not be a problem on the retry.
The ANSI SQL command-line appears to allow
SET LOCK WAIT <number of seconds>
However, the LockMode in hibernate seems to offer no equivalent to waiting on locks
http://docs.jboss.org/hibernate/core/3.5/javadoc/org/hibernate/LockMode.htmland LockOptions seems to only apply when one has a Query object or similar.
We use optimistic locking and annotations like
@Entity, @Table and @org.hibernate.annotations.GenericGenerator.
How is one supposed to wait on locks and retry using @Entity?
Or can we set this in the XML file at the DataSource or JDBCConnection level?
Thanks very much for your help.
Mary-Anne