2 Replies Latest reply on Nov 28, 2006 8:56 PM by Ciro Cavani

    Multi Managed Persistence Context Problem

    Ciro Cavani Novice

      My program has three different managed persistence context. In one form, I use two entity from two different context. I'm having IllegalArgumentException exception on Seam code because it tries use contains in persistence context that don't have the right entity mapped.

      org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor (at line 112):

      for (String persistenceContextName: pcs)
       {
       Object persistenceContext = Component.getInstance(persistenceContextName);
       boolean managed;
       Object id;
       if (persistenceContext instanceof EntityManager)
       {
       EntityManager em = (EntityManager) persistenceContext;
       managed = em.isOpen() && em.contains(value);
       id = managed ? PersistenceProvider.instance().getId(value, em) : null;
      


      I put a try-catch around "managed = ..." and it works normally.

      I don't know exactly how this should work, but I think this is a bug.

      Thanks,