Configuring the Java Persistence API (JPA) default persistence provider

Two persistence providers are included in WebSphere® Application Server: JPA for WebSphere Application Server persistence provider and Apache OpenJPA persistence provider. The JPA for WebSphere Application Server persistence provider is the default provider for WebSphere Application Server. You can use one of the two providers, or a third-party persistence provider, as the default provider.

About this task

On the application server's Feature Pack for Enterprise JavaBeans™ (EJB) 3.0, the default persistence provider, default Java™ Transaction API (JTA) datasource Java Naming and Directory Interface (JNDI) name, and default non-JTA datasource JNDI name, values are set through the following Java virtual machine (JVM) properties: com.ibm.websphere.jpa.default.provider, com.ibm.websphere.jpa.default.jta.datasource, and com.ibm.websphere.jpa.default.nonjta.datasource. Support for these properties has been deprecated. Any values that were set through these properties will be displayed as default values on this panel. Any change to these values through the Administrative Console panel will override any values set via the JVM properties.

While built from the Apache OpenJPA persistence provider, the JPA for WebSphere Application Server persistence provider contains the following enhancements and differences:
  • Enhanced tracing support
  • Version ID generation
  • ObjectGrid cache plug-in support
  • WebSphere product-specific commands and scripts
  • Translated message files
  • Static SQL support using the DB2® pureQuery feature
  • Access intent support
  • The following table shows how the default values for the JPA for WebSphere Application Server provider configuration properties are different from the Apache OpenJPA provider:
    Table 1. Comparison. JPA for WebSphere Application Server provider and Apache OpenJPA provider comparison
    Property Apache OpenJPA default value JPA for WebSphere Application Server default value
    openjpa.Compatibility StrictIdentityValues=false StrictIdentityValues=true
    openjpa.RuntimeUnenhancedClasses supported warn
    openjpa.DynamicEnhancementAgent true false

If no JPA provider is configured in the <provider> element of the persistence.xml file within an EJB module, the default JPA provider that is currently configured for this server is used. The WebSphere Application Server is packaged with the JPA for WebSphere Application Server persistence provider defined as the default provider. However, it is possible to override this default and specify a different default via the Websphere Administrative Console.

You can set your default persistence provider in one of two ways. Use one of the following procedures.

Procedure

  1. Select the default JPA provider from a list of providers included with WebSphere Application Server.
    1. Open the administrative console.
    2. From the left-hand navigation, navigate to Servers > Application Servers
    3. Select a server.
    4. Navigate to Container Services > Default Java Persistence API Settings
    5. Select Select a default persistence provider that is included with WebSphere Application Server.
    6. Click the slider and select from the list.
    7. Click Apply and save the configuration.
  2. Specify an alternative default persistence provider via the Administrative Console
    1. Open the administrative console.
    2. From the left-hand navigation, navigate to Servers > Application Servers
    3. Select a server.
    4. Navigate to Container Services > Default Java Persistence API Settings
    5. Select Specify an alternative default persistence provider .
    6. Enter the fully qualified JPA implementation class name of a JPA persistence provider in the box.
    7. Click Apply and save the configuration.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 11:50:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-iseries&topic=tejb_jpadefaultpp
File name: tejb_jpadefaultpp.html