-->
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.  [ 3 posts ] 
Author Message
 Post subject: Forcing refresh of query cache
PostPosted: Tue Mar 30, 2004 12:44 am 
Newbie

Joined: Wed Feb 11, 2004 3:29 pm
Posts: 5
Location: Washington, DC, USA
We have a database job which imports new data daily outside of hibernate's control. Since this job runs at roughly the same time every day, we have a scheduled job within our app server (JBOSS) which re-caches some of the more popular, long-running queries.

I've RTFM and some of the source but I don't see anyway to tell Hibernate to ignore the cached data, go to the database and reload the cache for a particular query -- note that simply nuking the whole cache or region isn't really a good option.

If something were to exist, I would guess a logical implementation would be as an optional flag for setCacheable: query.setCacheable(true, Cache.FORCE_REFRESH) or maybe another method call:

Code:
List blogs = sess.createQuery("from Blog blog where blog.blogger = :blogger order by blog.datetime desc")
    .setEntity("blogger", blogger)
    .setCacheable(true)
    .setCacheForceRefresh(true)
    .setCacheRegion("frontpages")
    .list();


So the specific questions:
  1. Did I miss something? Is there already an easy way to do this?
  2. What do you think of the idea? Might this be something interesting for future releases of Hibernate?
  3. Do you have any implementation ideas on this? (We might be able to do the code on this)

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 3:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Add a feature request to jira, Its a sensible suggestion.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 8:06 am 
Newbie

Joined: Wed Feb 11, 2004 3:29 pm
Posts: 5
Location: Washington, DC, USA
Done: http://opensource.atlassian.com/project ... wse/HB-859


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