Container Managed Persistence Context Introduction#
What Is The Container Managed Persistence Context?#
- The
Container Managed Persistence Context
- as the name states - is managed by the enterprise container (JEE Container or Spring). The container is responsible forPersistence Context
injection into enterprise components, and is also responsible for its disposal at the end of the current Transaction.Container-managed persistence context
might be defined to have one of two different scopes:Transaction persistence scope
orExtended persistence scope
. - The container, before performing an operation on the Entity, checks if there is a
Persistence Context
connected to thetransaction
; if not present, it creates a newPersistence Context
(session) and connects it. In practice, an EntityManager is automatically created for each newtransaction
. Operations such as commits and rollbacks are handled automatically by the Container. - You can find more here
- You can find more here
- You can find more here