[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


 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;


 Comments   
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 Thu Sep 03 14:10:47 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.