自由飞翔

我在仰望,java之上

统计

留言簿(2)

我关注的blog

阅读排行榜

评论排行榜

异常积累:org.hibernate.StaleStateException

ERROR - Exception executing batch: 
org.hibernate.StaleStateException: Batch update returned unexpected row count fr
om update [0]; actual row count: 0; expected: 1

ERROR - Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count fr
om update [0]; actual row count: 0; expected: 1


不注意的话,还真的有点无所适从,Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
这个异常是由于主键设置为自增长,而在我们插入记录的时候设置了ID的值导致的。看下我的Hibernate映射文件中ID的定义:

参考文章:http://hi.baidu.com/shirdrn/blog/item/adec1e82d067ddb86c81191c.html


Gavin

posted on 2012-04-18 15:33 GavinMiao 阅读(10558) 评论(0)  编辑  收藏 所属分类: 异常积累


只有注册用户登录后才能发表评论。


网站导航: