OpenJPA Caching Provider

Ehcache easily integrates with the OpenJPA persistence framework.

Installing

To use it, add a Maven dependency for ehcache-openjpa.

<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-openjpa</artifactId>
<version>0.1</version>

or download from downloads.

Configuration

Set the OpenJPA openjpa.QueryCache to ehcache and openjpa.DataCacheManager to ehcache. Thats it! See the Apache OpenJPA project for more on caching in OpenJPA.

Default Cache

As with Hibernate, Ehcache's OpenJPA module (from 0.2) uses the defaultCache configured in ehcache.xml to create caches. For production, we recommend configuring a cache configuration in ehcache.xml for each cache, so that it may be correctly tuned.