Program guide > Access data with client applications > Cache objects and their relationships (EntityManager API)



EntityTransaction interface

Use the EntityTransaction interface to demarcate transactions.


Purpose

To demarcate a transaction, you can use the EntityTransaction interface, which is associated with an entity manager instance. Use the EntityManager.getTransaction method to retrieve the EntityTransaction instance for the entity manager. Each EntityManager and EntityTransaction instance are associated with the Session. You can demarcate transactions with either the EntityTransaction or Session. Methods on the EntityTransaction interface do not have any checked exceptions. Only runtime exceptions of type PersistenceException or its subclasses result.

For more information about the EntityTransaction interface, see the API documentation.


Parent topic:

Cache objects and their relationships (EntityManager API)


Related concepts

EntityManager in a distributed environment

Interacting with EntityManager

EntityManager fetch plan support

EntityManager interface performance impact

Entity query queues


Related tasks

Entity manager tutorial: Overview

Related reference

Define an entity schema