我对我的应用程序使用了hibernate,spring,struts框架。Hibernate @Version Field error
在我的应用程序中,每个表都有一个称为Version的字段,用于跟踪任何记录的更新。
每当我更新其version 0我的国家表中的现有记录,它工作正常&更新记录更新版本字段为1
但每当我试图更新版本1的记录,它给我错误如下:
org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [com.sufalam.business.marketing.model.bean.Country] with identifier [3]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.company.business.marketing.model.bean.Country#3]
有没有什么办法可以解决它?
您可以发布您的代码吗? – 2009-05-01 12:12:46