-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Ehcache Configuration Problem on JPA with Hibernate
PostPosted: Sat Mar 05, 2011 5:38 am 
Newbie

Joined: Fri Mar 04, 2011 10:10 am
Posts: 2
Hi,

I am using JPA with Hibernate 3.5 Implementation. (But JPA 1.2 because of Myeclipse 8.6 IDE supports)
I am deploying on Tomcat container.

I have configured ehcache to cache the entity. But the entity are not getting cached.
Below is my configurations

In Persistence.xml

Quote:
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<properties>
....


<property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.SingletonEhCacheRegionProvider"/>
<property name="net.sf.ehcache.configurationResourceName" value="/ehcache.xml"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.EhCacheRegionFactory"/>
...
</properties>


On entity class,
In tried both
Quote:
@Cacheable(value=true) and @Cache(usage=CacheConcurrencyStrategy.READ_WRITE)


In ehcache.xml,

Quote:
<cache name="dev.entity.Country"
maxElementsInMemory="2000"
eternal="false"
timeToLiveSeconds="43200"
timeToIdleSeconds="7200"
overflowToDisk="false"
/>


Note: At the time of tomcat started, it is creating the empty cache files on temp folder.

If anything wrong in above configurations, please correct me to proceed.

Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.