-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: EntityNotFoundException from find() on base-class entity
PostPosted: Thu Nov 23, 2006 12:02 pm 
Newbie

Joined: Thu Jul 21, 2005 5:30 am
Posts: 5
We have a model using table-per-class inheritance and have a few abstract base class entities. When calling EntityManager.find() on a non-existent id for one of the concrete entity classes, the call returns null. When calling find() on a non-existent id on an abstract base class, an EntityNotFoundException is thrown. Is this intended behavior, are we missing a point in how to use find()?

Using Hibernate 3.2.1 GA, JBoss 4.0.5 GA


TIA,

Olaf


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
can you provide the stack track please?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 24, 2006 3:33 am 
Newbie

Joined: Thu Jul 21, 2005 5:30 am
Posts: 5
Here it is; let me know if you need more info.


Code:
javax.persistence.EntityNotFoundException: Unable to find com.pvs.pmm.pmmcore.entities.market.Market with id 100000000001074
        at org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:107)
        at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:223)
        at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:187)
        at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
        at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:174)
        at org.jboss.ejb3.entity.TransactionScopedEntityManager.find(TransactionScopedEntityManager.java:164)
        at com.pvs.pmm.common.services.BasePersistingServiceImpl.find(BasePersistingServiceImpl.java:75)
        at com.pvs.pmm.pmmcore.services.metrics.MetricLifecycleServiceImpl.processChangedBenchmarks(MetricLifecycleServiceImpl.java:241)
        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
        at com.pvs.pmm.common.interceptors.PropagateSessionContextInterceptor.myInterceptor(PropagateSessionContextInterceptor.java:46)
        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
        at com.pvs.pmm.common.interceptors.ExceptionMappingInterceptor.myInterceptor(ExceptionMappingInterceptor.java:54)
        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 4:35 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
a proxy of the same id is already present in your PC

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 7:42 pm 
Newbie

Joined: Mon Dec 11, 2006 10:27 am
Posts: 2
hello,
I have practically the same problem:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=11&t=012860
how you solved please?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.