2 Replies Latest reply on Sep 23, 2009 2:55 PM by Chris Simons

    Managed persistence context

    Chris Simons Expert

      Can anyone familiar with EJB3 and interoperability with non-JBoss application servers explain the difference between these two components.xml scenarios?


      Scenario 1



      <persistence:managed-persistence-context name="entityManager"
                     auto-create="true"
                     persistence-unit-jndi-name="/comp/env/#{project.name}/entityManagerFactory"/>
      
      
          <transaction:entity-transaction entity-manager="#{entityManager}"/>





      Scenario 2



      <transaction:ejb-transaction/>




      In addition, can you inject EntityManager, such as in:




      @In
      private EntityManager entityManager



      ...when using Scenario 2?