-->
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: Query Cache not timing out, or?
PostPosted: Wed Apr 09, 2008 4:58 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
Using JPA/Hibernate 3.2.2, not sure if this is a core or entitymanager question...

I can't seem to timeout my query cache. I have it enabled and it's working fine (DB backed resource bundle), but I was under the impression that a query like

Code:
   return entityManager.createQuery(
      "...")
      .setHint("org.hibernate.cacheable", true)
      .setHint("org.hibernate.timeout", 600)
      .getSingleResult();


Would reload the resource bundle data every 10 minutes. Now it never reloads and never pickes up the new resource bundle data. I'm using the HashtableCacheProvider (not that it should matter?).

Thanks in advance,
Nik


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 11:05 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi there,

I think you might misunderstand the meaning of these properties. org.hibernate.cacheable determines whether the query is cacheable or not. That's fine. However, org.hibernate.timeout is a hint which determines the timeout of the SQL/JDBC query. It does not mean how long the query cache is valid.

Now, if you want to configure the cache timeout for your query cache you will have to configure the cache region org.hibernate.cache.QueryCache which is the default cache region when you don't specify a custom name. How the configuration looks like depends on your cache provider.

I am not so sure what you mean with 'pickes up the new resource bundle data'.

Cheers,
--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 2:38 pm 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
hardy.ferentschik wrote:
I think you might misunderstand the meaning of these properties.


Aah, that explains it. Now I now where to start looking...

hardy.ferentschik wrote:
I am not so sure what you mean with 'pickes up the new resource bundle data'.


I was just referring to the desired behaviour that a value gets updated in the database (from an external source) and it would be picked up the next time the query cache would have been invalidated.


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.