Hi Georgi, Your configuration looks right. Are you experiencing problems with this configuration? I'm not positive that the ehcache team has done verification testing with OpenJPA 2.1.x, but the plug point should still work just fine. Let us know if you experience problems.
FYI, the QueryCompilationCache and QuerySQLCache are "on" by default, so there's no reason to include the "true" settings in your persistence.xml for these two properties. The "ehcache" settings are special values that signal to the ehcache plugin to set the other cache-related properties accordingly. That's why you do not need to set the RemoteCommitProvider and DataCache properties explicitly. Good luck, Kevin On Mon, Oct 11, 2010 at 4:11 AM, Georgi Naplatanov <go...@oles.biz> wrote: > Hi all. > > I want to configure ehcache 2.2.0, OpenJPA plugin for ehcache 0.2 and > OpenJPA 2.1-snapshot. > > Below are my configuration files, but I am not sure that it's right > configuration. > > persistence.xml > > <property name="openjpa.QueryCompilationCache" value="true"/> > <property name="openjpa.jdbc.QuerySQLCache" value="true"/> > <property name="openjpa.QueryCache" value="ehcache"/> > <property name="openjpa.DataCacheManager" value="ehcache"/> > > > ehcache.xml > > <?xml version="1.0" encoding="UTF-8"?> > <ehcache> > <defaultCache > maxElementsInMemory="1000" > eternal="false" > timeToIdleSeconds="300" > timeToLiveSeconds="600" > overflowToDisk="false" > memoryStoreEvictionPolicy="LRU" > /> > > <!-- OpenJPA data cache --> > <cache name="openjpa" > maxElementsInMemory="5000" > eternal="false" > timeToIdleSeconds="300" > timeToLiveSeconds="600" > overflowToDisk="false" > memoryStoreEvictionPolicy="LRU" > /> > > <!-- OpenJPA query cache --> > <cache name="openjpa-querycache" > maxElementsInMemory="1000" > eternal="false" > timeToIdleSeconds="300" > timeToLiveSeconds="600" > overflowToDisk="false" > memoryStoreEvictionPolicy="LRU" > /> > > </ehcache> > > Is this configuration correct ? > > Should I configure : > - "openjpa.DataCache" and "openjpa.RemoteCommitProvider" in > persistence.xml > - additional cache names in ehcache.xml > > Best regards > Georgi >