-->
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.  [ 2 posts ] 
Author Message
 Post subject: Periodic updates to the query cache.. How To?
PostPosted: Wed Feb 01, 2006 4:07 pm 
Newbie

Joined: Thu Jan 26, 2006 5:12 pm
Posts: 5
Hi,

I would to set up the Hibernate query cache to update itself at periodic intervals say every 5 minutes.

How do I go about doing that?

Also is it possible to programatically access this cache for forcing manual updates?

I am relatively new to Hiernate and any pointers or tutorials would be great.

thanks

SH


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 11:45 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You could spawn a thread that called session.clear, but then you'd have synchronization issues. You could alternatively write a wrapper class around SessionImpl that maintained a time-of-last-access, and called session.clear before any call to get, load, getNamedQuery, etc. if now - lastaccesstime > 5min.

You can get a handle to the ehcache cache using net.sf.ehcache.CacheManager.getInstance().


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.