`
tianyulif
  • 浏览: 19004 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

HibernateOptimisticLockingFailureException

    博客分类:
  • SSH
阅读更多



 今天在项目中遇到这样的错误,提示如下:
   1.Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
   2.Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
    这个错误主要出现在有关联表插入的时候,主要原因就是在做update的时候两个实体中的Id与数据库的不一致。检查一下看看在赋值Id的时候哪里出错了,就解决了。


 

  • 大小: 114.9 KB
分享到:
评论
2 楼 tianyulif 2012-01-09  
yulongde77 写道
不明白什么意思?

就是你做update的实体ID数据库中不存在
1 楼 yulongde77 2011-12-07  
不明白什么意思?

相关推荐

Global site tag (gtag.js) - Google Analytics