org.hibernate.StaleStateException

来源:互联网 发布:2015网络大电影排行榜 编辑:程序博客网 时间:2024/06/11 21:33
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的值导致的。
原创粉丝点击