Hitachi

uCosminexus Application Server Compatibility Guide


9.2.1 Processing in Cosminexus JPA Provider

Cosminexus JPA Provider provides the following functionality:

To use JPA, you operate the interfaces provided by Cosminexus JPA Provider by using the user-created applications. The following figure shows the processing executed in Cosminexus JPA Provider.

Figure 9‒2: Processing executed in Cosminexus JPA Provider

[Figure]

A description of the figure is as follows:

  1. Cosminexus JPA Provider generates EntityManagerFactory from the persistence unit information defined in persistence.xml.

    A persistence unit is a logical group that collects information such as the classes to be mapped, O/R mapping information, and the data sources. For details on a persistence unit, see 8.4.4 Persistence unit.

  2. EntityManager is generated from the generated EntityManagerFactory.

  3. EntityManager, query, or transaction is operated from the user application.

  4. The entity object is operated through the persistence context from EntityManager, query, or transaction.

  5. The changes in the entity object are applied to the database through the JDBC driver.

Note that there are two types of EntityManager:

For details on the types of EntityManager, see 8.5.1 EntityManager and persistence context.

Furthermore, a transaction manages operations such as the transaction commit and rollback. With Cosminexus JPA Provider, you can use the resource local transaction as the transaction. To integrate with JTA transactions, use the functionality provided by the J2EE container.