Tag: failed预览模式: 普通 | 列表
08-03
26

SQL insert, update or delete failed (row not found) 新解

这种错误多数在update时出现,在这里如果user的主建为空的时候,就insert,如果有主键的时候才update,不然没有主键,Hibernate没有依据来更新

Tags: row not found failed update

分类:Hibernate | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 936
在借助hibernate[1] 执行更新操作,包括插入(insert)/修改(update)/删除(delete)操作的过程中,如果数据库一方返回的update count 与 hibernate 所预期的 count[2] 不同,那么hibernate 的Batcher 就会抛出异常:

HibernateException("SQL insert, update or delete failed (row not found)");

下面是一段完整的错误信息:

[ERRor][tcpConnection-8080-3] - Could not synchronize database state with session
org.springframework.orm.hibernate.HibernateSystemException: SQL insert, update or delete failed (row not found); nested exception is net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found)
net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found)

查看更多...

Tags: row not found failed update

分类:Hibernate | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1084