Configuring the 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

While built from the Apache OpenJPA persistence provider, the JPA for WebSphere Application Server persistence provider contains enhancements and differences, including the following:
  • Statement batching support.
  • Version ID generation.
  • ObjectGrid cache plug-in support.
  • WebSphere product-specific commands and scripts.
  • Translated message files.
  • 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:
    Property Apache OpenJPA default value JPA for WebSphere Application Server default value
    openjpa.Compatibility StrictIdentityValues=false StrictIdentityValues=true
    openjpa.RuntimeUnenhancedClasses supported warn

If a JPA provider is not configured in the <provider> element, the default provider that is currently configured is used. No further configuration needs to be done. If you do not do additional configuration, the default provider, JPA for WebSphere Application Server provider, com.ibm.websphere.persistence.PersistenceProviderImpl, is configured.

For example, to set the Apache OpenJPA persistence provider as the default persistence provider, modify or set the default provider system property, com.ibm.websphere.jpa.default.provider, that is used in the server JVM definition to the value, org.apache.openjpa.persistence.PersistenceProviderImpl. Use the following steps to perform this action:

What to do next

The JPA for WebSphere Application Server persistence provider can be shared easily with many applications in a global environment. If you want to share the provider with other applications, you do not need to specify the default persistence provider in a <provider> element. If an application that uses the JPA persistence provider can access the bundles, it is able to use the default persistence provider.



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 Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 2:56:59 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-dist&topic=tejb_jpadefaultpp
File name: tejb_jpadefaultpp.html