-->
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.  [ 5 posts ] 
Author Message
 Post subject: how can i set the time reset cache data in "Query Cache
PostPosted: Thu Jul 15, 2004 4:46 am 
Newbie

Joined: Sun Jul 11, 2004 11:43 pm
Posts: 9
I have do the process
===========================================
List blogs = sess.createQuery("from Blog blog where blog.blogger = :blogger order by blog.datetime desc")
.setEntity("blogger", blogger)
.setMaxResults(15)
.setCacheable(true)
.setCacheRegion("frontpages")
.list();
=====================================
but ,what is the life cycle is over?
we can config it?
I need to reset it per day,can i do it ?

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 15, 2004 6:32 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
in ehcache.xml:
Code:
<ehcache>
..
   <cache name="net.sf.hibernate.cache.UpdateTimestampsCache"
      maxElementsInMemory="10000"
      eternal="false"
      timeToIdleSeconds="300"
      timeToLiveSeconds="600"
      overflowToDisk="false"
      />

   <cache name="net.sf.hibernate.cache.QueryCache"
      maxElementsInMemory="10000"
      eternal="false"
      timeToIdleSeconds="300"
      timeToLiveSeconds="600"
      overflowToDisk="false"
      />
</ehcache>


--
Leonid


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 15, 2004 6:46 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
and look at the new WIKI page about QueryCache: http://www.hibernate.org/213.html

--
Leonid


Top
 Profile  
 
 Post subject: thanks "shl ":
PostPosted: Fri Jul 16, 2004 1:45 am 
Newbie

Joined: Sun Jul 11, 2004 11:43 pm
Posts: 9
by the way,how to use the name with "net.sf.hibernate.cache.QueryCache" in java?
thanks a lots.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 16, 2004 2:58 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
"net.sf.hibernate.cache.QueryCache" is a default cache region, it should be used when you have not set required cache region with
Code:
Query.setCacheRegion("frontpages")

If you want to tune "frontpages" cache region, configure it in your ecache.xml:
Code:
...
<cache name="frontpages"
      maxElementsInMemory="10000"
      eternal="false"
      timeToIdleSeconds="300"
      timeToLiveSeconds="600"
      overflowToDisk="false"
      />


Read another thread about QueryCache configuration http://forum.hibernate.org/viewtopic.php?t=931007. In that thread michael, a hibernate team member, explained me QueryCache configuration.

--
Leonid


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.