No row with the given identifier exists

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了No row with the given identifier exists相关的知识,希望对你有一定的参考价值。

Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [cn.ipanel.itd.asset.entity.UserView2#1602]
at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:79)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:68)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
at cn.ipanel.itd.asset.entity.UserView2$$EnhancerByCGLIB$$7314bb97.getToDay(<generated>)
at sun.reflect.GeneratedMethodAccessor321.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.directwebremoting.impl.PropertyDescriptorProperty.getValue(PropertyDescriptorProperty.java:62)
... 36 more

楼主用了opensessioninview机制吗,
刷新出现这个错误,莫非你页面还有查询数据库的代码??!
一般view,control,Po三层分离,用onpensessioninview不会出现这种问题
_____________________________________________
hibernate二级缓存没有用吗,你删除怎么删的是
先查询到某个po然后删的吧
Po po=dao.findby(id);
dao.delete(po);

或者用session直接删除po吧,那么应该不会有错,
然后你没有用spring的hibernateTempter话,应该用一个
Transcation ta=session.beginTranscation();
Po po=dao.findby(id);
dao.delete(po);
ta.commit();
事务把删除事务包装起来,再不行楼主
do?showlist中的代码贴出来或者发给我我可以帮你看看
参考技术A UserView2表里不存在编号是1062的记录 参考技术B 1062是主键?应该是1062在表中不存在 参考技术C 仔细看看一对多和多对一关系。。哪一个字段依赖于另一个字段,而另一个字段可能被误删

以上是关于No row with the given identifier exists的主要内容,如果未能解决你的问题,请参考以下文章

org.hibernate.ObjectNotFoundException: No row with the given identifier exists

hibernate出现No row with the given identifier exists问题

No row with the given identifier exists

Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法(示例代码

org.hibernate.ObjectNotFoundException: No row with the given identifier exists

记录一次随意操作数据库,插入新数据,导致与程序添加新数据时,引起的主键值重复问题。More than one row with the given identifier was found: 1690