1Z0-898 · Question #39
A developer has created an application managed entity manager. Which statement is correct?
The correct answer is A. A new persistence context begins when the entity manager is created. Application-Managed Entity Managers With an application-managed entity managerthe persistence context is not propagated to application components, and the lifecycle of EntityManager instances is managed by the Application-managed entity managers are used when applications need…
Question
A developer has created an application managed entity manager. Which statement is correct?
Options
- AA new persistence context begins when the entity manager is created.
- BA new persistence context begins when a new JTA transaction begins.
- CA new persistence context begins when the entity manager is invoked in the context o\
- DA new persistence context begins when the entity manager is invoked in the context of a
How the community answered
(26 responses)- A73% (19)
- B15% (4)
- C8% (2)
- D4% (1)
Explanation
Application-Managed Entity Managers With an application-managed entity managerthe persistence context is not propagated to application components, and the lifecycle of EntityManager instances is managed by the Application-managed entity managers are used when applications need to access a persistence context that is not propagated with the JTA transaction across EntityManager instances in a particular persistence unit. In this case, each EntityManager creates a new, isolated persistence context. The EntityManager and its associated persistence context are created and destroyed explicitly by the application.
Topics
Community Discussion
No community discussion yet for this question.