WAS v8.5 > Tune performance > Tune EJB applications > Tune applications that use the Java Persistence API

Configure WSJPA ObjectCache to improve performance

The WebSphere Java Persistence API (WSJPA) extension to OpenJPA provides a read-only object cache that can improve performance in certain use cases. Implementing a WSJPA ObjectCache object can improve the performance of an application that has a set of data used in a static, read-only method, like accessing basic persistent fields and persisting unidirectional relationships to a read-only type. WSJPA ObjectCache is a non-distributed cache of read-only entities that operates at the EntityManagerFactory object level. These cached instances are shared by all EntityManager objects in the JVM, but the instances are not managed by any. When the feature is enabled, the ObjectCache object is examined before the application accesses the OpenJPA DataCache object and database, and persistent objects are loaded from the database and stored in the OpenJPA object cache. In addition, the ObjectCache implementation can be used with OpenJPA DataCache and QueryCache features for even greater performance.

Be aware of the following conditions and limitations:

We can enable the object cache for a single JVM environment, specify the types that are included in this cache, set its maximum element size, and specify timeout values.

The preferred property name is wsjpa.ObjectCache, but openjpa.ObjectCache is also a valid configuration.

To enable automatic loading of the entire ObjectCache when the first EntityManager object is created, follow the steps in the Pre-loading the WSJPA ObjectCache automatically topic. In addition, we can read more about caching in the OpenJPA User Guide for information about all caching extensions.


Related


Pre-loading the WSJPA ObjectCache automatically
Develop JPA 2.x applications for a Java SE environment
Develop JPA 2.x applications for a Java EE environment


Related information:

Apache OpenJPA User Guide


+

Search Tips   |   Advanced Search