openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Borkowski <borkos.de...@gmail.com>
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:

@Entity
@DataCache(name="animals")
public class Cat

@Entity
@DataCache(name="animals")
public class Dog

excerpt from ehcache.xml:
    <cache name="animals"
           maxElementsInMemory="5"
           eternal="false"
           overflowToDisk="false"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           memoryStoreEvictionPolicy="LFU"
            />

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

regards,
Adam Borkowski

-- 
View this message in context: http://n2.nabble.com/EhCache-integration-questions-tp4715365p4715365.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message