08-03
26
Hibernate 的 "SQL insert, update or delete failed (row not found)" 异常
作者:Java伴侣 日期:2008-03-26
在借助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)
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)
通过调用JS脚本来实现的Lightbox效果我想大家都很熟悉了,
我在econsultant.com看到了介绍Lightbox类似程序的帖子,发出来共享一下。
Lightbox JS
: original; a simple, unobtrusive script used to overlay images on the current page.
Greased Lightbox
: Greasemonkey/Creammonkey/Opera user script designed to enhance browsing on websites that link to images such as Google Image Search, Flickr, Wikipedia, Facebook, MySpace, and deviantART.
GreyBox
: A pop-up window that doesn’t suck.
我在econsultant.com看到了介绍Lightbox类似程序的帖子,发出来共享一下。
Lightbox JS
: original; a simple, unobtrusive script used to overlay images on the current page.
Greased Lightbox
: Greasemonkey/Creammonkey/Opera user script designed to enhance browsing on websites that link to images such as Google Image Search, Flickr, Wikipedia, Facebook, MySpace, and deviantART.
GreyBox
: A pop-up window that doesn’t suck.
复制内容到剪贴板 程序代码
net.sf.hibernate.PropertyNotFoundException:Could not find a getter for isAdmin in class order.vo.UserStatus
可能会有人纳闷这个Hibernate错误,我怎么会归类到Eclipse分类中,其实我今天遇到这个错误并不关hibernate什么事情,而是eclipse生成的getter/setter方法让hibernate不认,一般来说当值对象VO中有布尔类型变量,那么会把get方法取而代之为is.下面是ecplise自动生成的代码,也是hibernate报错的代码:
复制内容到剪贴板 程序代码
private boolean isAdmin;
public boolean isAdmin() {
return isAdmin;
}
public void setAdmin(boolean isAdmin) {
this.isAdmin = isAdmin;
public boolean isAdmin() {
return isAdmin;
}
public void setAdmin(boolean isAdmin) {
this.isAdmin = isAdmin;