[jboss-user] [JBoss Seam] - JPA/Hibernate Entity: broken identity between Entity & Objec

pierospinelli do-not-reply at jboss.com
Sat Dec 1 07:02:01 EST 2007

Since I've some trouble in extracting a significant frame of code, I'll try to put the question in general terms:

During the same SEAM request to an action (an EJB method), I build a set of entities navigating relations from other entities returned by different queries, expecting the same entity can be navigated more than once.

I expected that, in this case, the same Entity (same class & id) would be even the same Java Object instance (since all the navigations & queries were inside the same request): but in some case I HAVE TWO DIFFERENT OBJECT INSTANCES (both verified to be contained in the same EntityManager) FOR THE SAME ENTITY (same class & id).

I thought it were against the JPA specification, can anyone confirm this?

I am trying to play with the Hibernate properties & with the query hints about cache, but I have had no luck till now.

Does anyone know if the are some specific situations where more objects can represent the same entity inside the same EntityManager and if it exists some method to avoid this?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109527#4109527

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109527

More information about the jboss-user mailing list