3 Replies Latest reply on Apr 7, 2010 9:39 AM by phantasmo

    Conversation scoped EntityManager

    phantasmo

      Is it possible to have a conversation scoped EntityManager, like we had in Seam, or is it now necessary to have a different conversation scoped bean holding reference to it? Is this something that is not a part of Weld but will be a part of Seam 3 or is it time to kiss this feature good bye?

        • 1. Re: Conversation scoped EntityManager
          swd847

          You do it like this:


          
          public class Databases {
          
              @Produces @PersistenceContext(unitName="UserData")
              @ConversationScoped
              @Users EntityManager userDatabaseEntityManager;
          
          }
          
          
          

          • 2. Re: Conversation scoped EntityManager
            nickarls

            It will probably by in the Seam Persistence module

            • 3. Re: Conversation scoped EntityManager
              phantasmo

              Stuart Douglas wrote on Apr 07, 2010 06:00:


              You do it like this:

              
              public class Databases {
              
                  @Produces @PersistenceContext(unitName="UserData")
                  @ConversationScoped
                  @Users EntityManager userDatabaseEntityManager;
              
              }
              
              
              




              So it's as I have guessed. Thank you for explaining.




              Nicklas Karlsson wrote on Apr 07, 2010 08:55:


              It will probably by in the Seam Persistence module


              I certainly hope so, as I believe this to be the example of boiler code Seam was designed to avoid. Thanks for the tip.