草庐IT

ObjectNotFoundException

全部标签

java - 具有大量并发事务的 Hibernate 二级缓存 ObjectNotFoundException

我们有一个Java应用程序,它使用MySQL、Hibernate(3.5.1-Final)和EHcache(1.2.3)作为我们的二级缓存。我们的hibernate.properties隔离级别是Read-committedisolation=2#2-Readcommittedisolationhibernate.connection.isolation=2在大量并发事务下,我们发现某些集合(数据库关联)​​在加载时会抛出ObjectNotFoundException并且似乎二级缓存正在返回该集合的旧副本。我们有许多不同类型的事务访问此集合(仅阅读),但只有几个会向其中添加/删除项目。

java - 由于 ehcache,许多并发读取 + 一个写入导致 ObjectNotFoundException

我在高流量站点上使用Hibernate3.6.8、ehcache2.4.5(也尝试过最新的2.8.0)、jvm1.6.0_22,有时我会遇到ObjectNotFoundException:Norowwiththegivenidentifierexists:[com.example.Foo#123]`当通过尽可能简单的代码创建新的Foo(在本例中为id123)时:Foofoo=newFoo();session.save(foo);原因是在这个高流量站点的所有页面中,我得到所有Foo,如下所示:session.createQuery("fromFoo").setCacheable(true

java - org.hibernate.ObjectNotFoundException : No row with the given identifier exists, 但它确实

我遇到了一个无法修复的hibernate问题。设置:JavaEE、网络应用、Hibernate3.2、Tomcat6、Struts2。基本上,我使用我的服务器逻辑(一个struts操作)持久化一个对象,然后尝试将该数据提取到下一页并显示它。我在保存对象后检查了数据库,果然,我可以看到那里有所有数据的行。但是当我尝试检索它时,我得到了这个:org.hibernate.ObjectNotFoundException:Norowwiththegivenidentifierexists:[msc.model.Picture#73]为了让事情变得更加困惑,当我重新启动Tomcat并尝试访问同一个

java - org.hibernate.ObjectNotFoundException : No row with the given identifier exists, 但它确实

我遇到了一个无法修复的hibernate问题。设置:JavaEE、网络应用、Hibernate3.2、Tomcat6、Struts2。基本上,我使用我的服务器逻辑(一个struts操作)持久化一个对象,然后尝试将该数据提取到下一页并显示它。我在保存对象后检查了数据库,果然,我可以看到那里有所有数据的行。但是当我尝试检索它时,我得到了这个:org.hibernate.ObjectNotFoundException:Norowwiththegivenidentifierexists:[msc.model.Picture#73]为了让事情变得更加困惑,当我重新启动Tomcat并尝试访问同一个

java - 是否有一个标准的 java 异常类表示 "The object was not found"?

考虑以下一般形式的函数:FoofindFoo(Collectionfoos,otherarguments)throwsObjectNotFoundException{for(Foofoo:foos){if(/*foomeetssomecondition*/){returnfoo;}}thrownewObjectNotFoundException();}例如,一个具体的案例是:UserfindUserByName(Collectionusers,Stringname)throwsObjectNotFoundException{for(Useruser:users){if(user.get

java - 是否有一个标准的 java 异常类表示 "The object was not found"?

考虑以下一般形式的函数:FoofindFoo(Collectionfoos,otherarguments)throwsObjectNotFoundException{for(Foofoo:foos){if(/*foomeetssomecondition*/){returnfoo;}}thrownewObjectNotFoundException();}例如,一个具体的案例是:UserfindUserByName(Collectionusers,Stringname)throwsObjectNotFoundException{for(Useruser:users){if(user.get

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

自Hibernate4.1.8以来我遇到了一个问题,导致以下异常:org.hibernate.ObjectNotFoundException:Norowwiththegivenidentifierexists:[test.hibernate.TestPrepravkaOsobaSAdresou$Uvazek#2]我在两个实体之间有一个简单的OneToMany关联:@Entity(name="Ppv")@Table(name="PPV")publicstaticclassPpv{@IdLongppvId;@OneToMany(fetch=FetchType.EAGER,mappedBy=