openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akash Gunjal <akgun...@in.ibm.com>
Subject Persisting an entity managed by a different entity manager
Date Thu, 17 Oct 2013 17:23:06 GMT

Hello,

I am facing a transaction issue with the entity manager injected using
blueprint.xml. There are 2 persistence bundles each managing different
entities. For instance, the entity1 managed by entityManager1 holds an
entity2 managed by entityManager2. So when the entityManager1 tries to
persist its entity1, the I get an error since internally entity1 holds
entity2 which cannot be persisted by entityManager1.

The solution to this is to detach the entity2 from the entityManager2. But
since the entity managers are loaded through persistence units by using JPA
annotation @PersistenceContext, this detaching cannot be done. So what
could be the alternate solution to this issue.

Regards,
Akash


Mime
View raw message