JPA - Persistence Context

Card Puncher Data Processing


A persistence context is a set of entity instances in which for any persistent entity identity there is a unique entity instance.

Within the persistence context, the entity instances and their operations are managed.


The lifetime of a container-managed persistence context can either be scoped to:

  • (default) a transaction (transaction-scoped persistence context),
  • a lifetime that extends beyond that of a single transaction (extended persistence context).

Documentation / Reference

Discover More
Card Puncher Data Processing
JPA - Entity (Operations|Lifecycle)

All entity operations are described in the chapter 3: Entity Operations of the specification The following operations are possible: PERSIST, MERGE, REMOVE, REFRESH, DETACH FLUSH This...
Card Puncher Data Processing
JPA - Entity Manager

To manage entities in your persistence application, you need to obtain an javax/persistence/EntityManagerentity manager from an javax/persistence/EntityManagerFactoryEntityManagerFactory. An javax/persistence/EntityManagerEntityManager...
Card Puncher Data Processing
JPA - Managed Entity

future updates to the entity will be tracked. persistence context The contains() method can be used to determine whether an entity instance is managed in the current persistence context. The...
Card Puncher Data Processing
JPA - Transaction

The managed entities of: a transaction-scoped persistence context become detached when the transaction commits. an extended persistence context remain managed. For both transaction-scoped and...

Share this page:
Follow us:
Task Runner