5 Replies Latest reply on Feb 27, 2012 6:44 AM by hantsy bai

    EntityManager from long running conversation injected in RequestScoped bean without propagation

    miguelzp Newbie

      What a strange thing using Seam managed persistence:


      I. Producer.java






          EntityManagerFactory emf;



      II. Managed Bean 1:



      public class Bean1 ...




          private EntityManager entityManager;




      III. Simple href without params clicked during long running conversation with Bean1 implicated


      <h:outputLink value="page2.xhtml" target="_blank">

                              <h:outputText value="Go" />




      IV. Managed Bean 2 with method called by s:viewAction in page2.xhtml:



      public class Bean2 ...



          private EntityManager entityManager;




      --> EntityManager injected in Bean2 is the same instance as in Bean1 without any cid param, cookie etc. that could propagate the conversation (I checked the http)


      How could this behaviour be explained?


      How can I force a new EntityManager (PC) instance for each request in Bean2?