openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georgi Naplatanov (JIRA)" <>
Subject [jira] Created: (OPENJPA-548) Obtaining EntityManager with createEntityManager(PersistenceContextType.EXTENDED)
Date Fri, 28 Mar 2008 09:50:24 GMT
Obtaining EntityManager with createEntityManager(PersistenceContextType.EXTENDED)

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

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message