WAS v8.5 > Administer applications and their environment > Welcome to administering EJB applications > Administer applications that use the Java Persistence API

Configure JPA to work in the environment

You have developed the applications to work with JPA and now configure your JPA applications to work in the environment.

Specify options for the database as a part of configuring JPA applications. The application server manages access to data sources. We can configure the data sources, connection pooling, and Java Transaction API (JTA) service in the dmgr console. If we have a specific data source for the application, configure the data source before you install your JPA application.

  1. Configure your data sources through the dmgr console. See the topic, Configure a JDBC provider and data source.

  2. Specify the JNDI names for the <jta-data-source> and <non-jta-data-source> elements. For example to use JNDI lookup:

      <jta-data-source>jdbc/myJTADataSource</jta-data-source> <non-jta-data-source>jdbc/myNonJTADataSource</non-jta-data-source>

    If we use the component name space method (for example, java:comp/env) for data source retrieval, ensure the application defines these resource references so that we can use these JNDI names to access the data source. This component name space configuration provides more flexibility if you must alter the configuration for the data source. Otherwise, the standard, direct JNDI is used as the data source name. For more information about using the JNDI interface, see the topic, Developing applications that use JNDI. For example, the persistence.xml file would have an entry like the following:

      <jta-data-source>java:comp/env/jdbc/DataSourceJNDI</jta-data-source>
    OR

      <jta-data-source>jdbc/DataSourceJNDI</jta-data-source>
  3. Configure persistence provider support in the application server.

    1. Configure the JPA default persistence provider.

    2. Optional: Use third-party persistence providers.

For more information about the commands, classes or other OpenJPA information, refer to the Apache OpenJPA User Guide.


Subtopics


Related


Map persistent properties to XML columns for JPA
Associate persistence providers and data sources
Configure a JDBC provider and data source
Tasks: IBM Optim pureQuery Runtime
Configure pureQuery to use multiple DB2 package collections
Configure JDBC providers to use pureQuery to access DB2
Configure JDBC providers to use pureQuery to access Informix
Configure data source JDBC providers to use pureQuery in a Java SE environment
Develop applications that use JNDI


Reference:

Criteria API


Related information:

Apache OpenJPA User Guide: JPA

Apache OpenJPA User Guide: JPA Criteria

Apache OpenJPA User Guide

Dynamic, typesafe queries in JPA 2.0
IBM System i: PTF Cover Letters
IBM Support: Fix Central for DB2 UDB for iSeries V6R1
IBM Support: Fix Central for DB2 UDB for iSeries V5rR3


+

Search Tips   |   Advanced Search