-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate cache does not work
PostPosted: Tue Aug 23, 2005 9:25 am 
Newbie

Joined: Wed Dec 08, 2004 11:30 am
Posts: 8
I did set up hibernate config:
<property name="hibernate.cache.enable_cache">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.statement_cache.size">25</property>
<property name="hibernate.cache.provider_class"> net.sf.hibernate.cache.EhCacheProvider</property>
<class-cache class="com.mrt.vend.desktop.model.MachineSettingData" usage="read-only"/>

oraz xml file in my classpath

<ehcache>

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

<defaultCache
maxElementsInMemory="10000"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
/>

<cache name="com.mrt.vend.desktop.model.MachineSettingData"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="1500"
timeToLiveSeconds="3600"
overflowToDisk="false"
/>
</ehcache>

I make call Iterator iter = criteria.setCacheable(true).list().iterator();

however caching is not working, what should I do to make it working ?


Top
 Profile  
 
 Post subject: seems to work fine in H3 CVS trunc
PostPosted: Tue Aug 23, 2005 3:56 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
seems to work fine in H3 CVS trunc

- provider name is a bit different:
<property name="hibernate.cache.provider_class"> org.hibernate.cache.EhCacheProvider</property>

- then classpath should have ehcache.xml file that will configure the cache

see also http://www.hibernate.org/hib_docs/v3/re ... ance-cache

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: cache does not work
PostPosted: Wed Aug 24, 2005 2:49 am 
Newbie

Joined: Wed Dec 08, 2004 11:30 am
Posts: 8
I am using hibrnate version 2.1.8 where cache is not working , version 3 has maybe cache working but has many other problems.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 6:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
wow - that was a serious oneliner with no substantial evidence at all ;)

_________________
Max
Don't forget to rate


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.