検索

ホームページ  >  に質問  >  本文

java - s2sh购物网站的版本控制version,遇到update就出错

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

以下是错误代码:
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中文网2889日前366

全員に返信(1)返信します

  • 大家讲道理

    大家讲道理2017-04-17 18:00:08

    更新された主キーは 0 で、対応するデータがありません。更新する前にデータを印刷するとわかります。

    返事
    0
  • キャンセル返事