Hi,
according to the ejb persistence spec (chapter 3.2.4):
anonymous wrote : A detached entity may result from transaction commit if a
transaction-scoped container-managed entity manager is used (see section 3.3); from
transaction rollback (see section 3.3.2); from clearing the persistence context; from
closing an entity manager; and from serializing an entity or otherwise passing an entity
by value, e.g. to a separate application tier, through a remote interface, etc.
Does any of those cases apply to your app? You have the special case that the
EntityManager is only in "Bean1", so I don't know whether calling a method
from "Bean2" means that the persistence context is cleared afterwards.
Here is something from chapter 5.6.1, but this does not make it much clearer:
anonymous wrote : A new persistence context begins when the container-managed entity
manager is invoked in the scope of an active JTA transaction, and there is no current
persistence context already associated with
| the JTA transaction. The persistence context is created and then associated with the
JTA transaction.
|
| The persistence context ends when the associated JTA transaction commits or rolls
back, and all entities that were managed by the EntityManager become detached.
|
| If the entity manager is invoked outside the scope of a transaction, any entities
loaded from the database will immediately become detached at the end of the method call.
Hope this helps a bit
Wolfgang
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190393#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...