I don't know if I entirely follow your post, but why can't you detach the
Entity from one EntityManager and merge it into the other?


On Thu, Oct 17, 2013 at 12:23 PM, Akash Gunjal <akgun...@in.ibm.com> wrote:

>
> 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
>
>


-- 
*Rick Curtis*

Reply via email to