javaeetutorial
  1. javaeetutorial
  2. JAVAEETUTORIAL-146

Incorrect code snippet showing application-managed entity manager

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.7-5
    • Fix Version/s: 7.0.0
    • Component/s: doc
    • Labels:
      None

      Description

      From the email feedback alias:
      On the page: http://docs.oracle.com/javaee/6/tutorial/doc/bnbqw.html
      This fragment appears under the section "Application-Managed Entity Managers" :

      ----------------------------------------------------

      The following example shows how to manage transactions in an application that uses an application-managed entity manager:

      @PersistenceContext
      EntityManagerFactory emf;
      EntityManager em;
      @Resource
      UserTransaction utx;

      ---------------------------------

      It seems to me from the other text that @PersistenceContext should actually be @PersistenceUnit,
      but as I am just learning JPA, I may very well be wrong. Either I am correct, or the explanation is not clear.

      The user is correct. It should be:

      @PersistenceUnit
      EntityManagerFactory emf;
      EntityManager em;
      @Resource
      UserTransaction utx;
      

        Activity

        Ian Evans created issue -
        Ian Evans made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Ian Evans added a comment -

        Fixed in source. If we update the EE 6 tutorial, the fix will appear there. Otherwise, the fix will appear in the EE 7 tutorial.

        Show
        Ian Evans added a comment - Fixed in source. If we update the EE 6 tutorial, the fix will appear there. Otherwise, the fix will appear in the EE 7 tutorial.
        Ian Evans made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 7.0.pre [ 15606 ]
        Resolution Fixed [ 1 ]
        Ian Evans made changes -
        Fix Version/s 7.0.0 [ 15607 ]
        Fix Version/s 7.0.pre [ 15606 ]

          People

          • Assignee:
            Ian Evans
            Reporter:
            Ian Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: