[JAVAEETUTORIAL-146] Incorrect code snippet showing application-managed entity manager Created: 09/Jan/13  Updated: 05/Feb/13  Resolved: 05/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


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:

EntityManagerFactory emf;
EntityManager em;
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:

EntityManagerFactory emf;
EntityManager em;
UserTransaction utx;

Comment by Ian Evans [ 05/Feb/13 ]

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.

Generated at Tue Feb 21 03:57:19 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.