JPA Architecture
Q: Why use Ebean over EJB3's JPA in the first place?
A: The JPA architecture will give Developers unwanted complications when running outside of a container.
EntityManager and Session Management
EntityManager in JPA acts as a Session object for a user. In this sense the EntityManager can not be
shared by different users in the system. This matches with the Hibernate Session object
and similarly with Toplink ClientSession object.
In using JPA you (the Developer) will have to decide how to manage the EntityManager. You will choose
between creating a new EntityManager instance for each Transaction or keeping the EntityManager and reusing
the same EntityManager instance over multiple requests (Extended Persistence Context).
EntityManager (and Hibernate Session) are user Session objects.
|