我提示以下错误:在我的Web应用程序:Hibernate的乐观锁定异常
Handling an unexpected exception in webApp: - javax.servlet.error.status_code = 500 - javax.servlet.error.exception_type = class org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException - javax.servlet.error.message = Object of class [domain.entity.common.dataEntity] with identifier [110837262]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [domain.entity.common.dataEntity
我不知道为什么这个错误发生时,它在下面的行中出现。
SpecEntity specTemp = this.persistService.merge(specTemp);
是否有人可以帮助这里..
感谢或答复。我想知道的东西如..为什么它扔在GenDataEntity误差GenDataEntity延伸SpecEntity ..会出现这种情况,如果有合并或在SpecEntity同一会话坚持..我们可以跟踪在数据库中通过其ID-110837262陈旧的对象.. – Trin
@Teena不知道如果我可以回答,而不看你的域模型和你的应用程序的流程。现在,既然您知道问题的症结所在,并且可能会发生此异常,则可以启用show_SQL属性,并查看导致问题的确切顺序的事件。 –