1 Reply Latest reply on Oct 25, 2006 6:42 AM by bluetrade

    Working with 2 EntityManagers

    bluetrade

      Hi,
      I was wondering if anyone had experience in working with 2 Entity Mangers in Seam. Let's say I have a User-Entity that is controlled by one EM (in one DB) and I have the Access Rights in a different DB which is of course then controlled by a different EM, can the EM manage this relationship even though it does not know about the internals of the other component? Meaning, I send an authentication request to EM1 with username, pwd and get back a User Object - now I want so save some access rights and reference to that object - how could this be done?

      Thanks,
      Joey

        • 1. Re: Working with 2 EntityManagers
          bluetrade

          One thing I forgot, I of course tried just leaving out cascading the second entity and doing everything just like I would with a "locally" managed bean - but as expected in this case I get a ConstraintViolationException, because the foreign key constraint does not hold... so basically, is there a way to leave out the foreign key constraint?

          Thanks,

          Joey