Obtaining EntityManager with
createEntityManager(PersistenceContextType.EXTENDED)
---------------------------------------------------------------------------------
Key: OPENJPA-548
URL: https://issues.apache.org/jira/browse/OPENJPA-548
Project: OpenJPA
Issue Type: Bug
Components: docs
Affects Versions: 1.0.2
Reporter: Georgi Naplatanov
Priority: Minor
The example from OpenJPA documentation "Example 3.1. Interaction of Interfaces
Outside Container" does not compile.
The following line is wrong:
// get an EntityManager from the factory
EntityManager em = factory.createEntityManager(PersistenceContextType.EXTENDED);
It's a good idea to be clear in the OpenJPA documentation:
The only way to obtain EntityManager with transaction persistence context is
to use these injected by the container.
There are two ways to obtain EntityManager with extended persistence context
within container:
- by factory, by invoking createEntityManager()
- injected within Stateful Session Bean with following annotation:
@PersistenceContext(type=EXTENDED)
EntityManager em;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.