java - s2sh购物网站的版本控制version,遇到update就出错
PHP中文网
PHP中文网 2017-04-17 17:58:08
0
1
312

我用s2sh做购物网站,里面用到了版本控制version,save和delete没有问题,但update就显示出错。
我一运行就点update,所以不存在已有一个线程在。
我觉得是这个问题,不知对不对。

以下是错误代码:
org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Object of class [com.fangyun.entity.Product] with identifier [0]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.fangyun.entity.Product#0]

org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.fangyun.entity.Product#0]

PHP中文网
PHP中文网

认证0级讲师

全部回覆 (1)
大家讲道理

更新的主鍵為0,沒有對應數據,更新前列印下數據看看就知道了!

    最新下載
    更多>
    網站特效
    網站源碼
    網站素材
    前端模板
    關於我們 免責聲明 Sitemap
    PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!