persistence context

The set of entities JPA is currently tracking in a unit of work, whose changes it writes to the database automatically.

In more detail

Loading an entity inside a transaction makes it managed; changing a field is then enough to update the row at commit. Lazy relationships only load while the context is open. Controllers should never see or manage database sessions.

Related terms

Taught in

References