`

异常积累: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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics