openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Borkowski <>
Subject EhCache integration questions
Date Thu, 11 Mar 2010 11:14:34 GMT

As OpenJPA L2 cache itself doesn't support dividing persistent classes into
multiple data caches I'm trying to use ehcache together with openjpa. Two
questions regarding this:

1) Is it possible to set data cache disabled by default for all classes and
then enable only few chosen by annotating them with
@DataCache(enabled=true),  or something similar?

2) I noticed that ehcache creates separate data cache for each persistent
class. Is there a way to group persistent classes in a less granular way?

Let's say that I have classes Cat and Dog and want them to use common
ehcache configuration "animals".
Until now I can't make it happen. I tried below configuration:

public class Cat

public class Dog

excerpt from ehcache.xml:
    <cache name="animals"

excerpt from persistence.xml

          <property name="openjpa.DataCache" value="ehcache"/>

I'm using:
- ehcache-core-1.7.2
- ehcache-openjpa-0.2.0
- openjpa-1.2.2

Adam Borkowski

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message