3 Replies Latest reply on Sep 24, 2008 10:11 PM by swd847

    jboss.entity.manager.factory.jndi.name does not publish anyt

    wdrai

      Looking at the sources of PersistenceUnitDeployment, the code that put the factory in JNDI is commented.

      Does this mean that this option will not be supported any more ?

        • 1. Re: jboss.entity.manager.factory.jndi.name does not publish
          wolfc

          No, like I said in the comment it needs to be reinstated.

          Note that it's not appropriate to do a global lookup of the persistence unit, it will not create an explicit dependency. It is better to use injection.

          The commented out classes have a hard dependency on ejb3-core, this needs to be refactored into a proper spi. After that it can be reinstated.

          • 2. Re: jboss.entity.manager.factory.jndi.name does not publish
            wdrai

            I'm just using this property to configure a Seam managed persistence context. This is how it's done in the Seam documentation.

            It would have been useful to give the information that this property is disabled in CR2 somewhere in the release notes, maybe with a workaround.

            • 3. Re: jboss.entity.manager.factory.jndi.name does not publish
              swd847

              I have run into the same problem trying to test my seam app on jboss 5.

              I used the follow ugly hack of a workaround:

              
              @Stateless
              @Name("entityManagerFactory")
              public class EntityManagerFactoryHackBean implements EntityManagerFactoryHackLocal {
              
               @PersistenceUnit(name="main")
               EntityManagerFactory factory;
              
               @Unwrap
               public EntityManagerFactory getEntityMangagerFactory()
               {
               return factory;
               }
              
              }
              
              


              the in components.xml

              <persistence:managed-persistence-context name="entityManager"
               entity-manager-factory="#{entityManagerFactory}"
               scope="conversation" auto-create="true" />