We used Spring/Hibernate in a web application. On the same server, we have some standalone programs that are called manually from some Unix scripts. We just encountered a case when a program was called, and a StaleObjectStateException was thrown:
org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
I found that the exception occurred in a query. What could be due to it?
posted 13 years ago
This option is specified in the HBM file:
I think this could have caused the exception. What I don't understand is that I only do a query, so there is no update involved. Why would the exception occur?