-->
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 implemented in Hibernate
PostPosted: Sat Jul 04, 2009 1:49 am 
Newbie

Joined: Tue Jun 30, 2009 5:10 am
Posts: 1
Hi All,

I have used hibernate 3.2ga and i tries to implement to Ehcache

I done following things
Hibernate.cfg.xml


<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
<property name="net.sf.ehcache.configurationResourceName">/ehcache.xml</property>


at Eache.xml

<ehcache>
<diskStore path="java.io.tmpdir"/>

<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>

<cache name="com.mymdworld.server.model.MessageConfig"
maxElementsInMemory="300"
eternal="true"
overflowToDisk="false"
/>

</ehcache>

at Messageconfig DAo file

Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Table(name = "MessageConfig")
public class MessageConfig {


and i put the ecache.jar in classpath.

compliation is sucessed.
When i am trying to the get status of ecashe it show s 0

stats.setStatisticsEnabled(true);
System.out.println(" Secondlevel Quische= "+stats.getSecondLevelCacheHitCount());
System.out.println(" Query cashe Hit ratio= "+stats.getSecondLevelCacheMissCount());


But it should come when cache hits 1.

Kindly let know why it is not comeing the Hit count?

Your help was appricted?


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.