-->
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.  [ 1 post ] 
Author Message
 Post subject: Query Cache doesn't work as expected
PostPosted: Wed Jul 18, 2007 10:15 am 
Newbie

Joined: Wed Jul 18, 2007 9:51 am
Posts: 2
Dear guru,

I am trying to use query cache and have found it not working in my configuration. Below are details.

Mapping:
Code:
<class name="IdNameDto"
   entity-name="UserStatus"
   table="user_status"
   mutable="false">
  <id name="id" column="user_status_id" type="integer" />
  <property name="name" column="user_status_name" type="string" />
</class>


Query:
Code:
session.createQuery("From UserStatus order by name")
                    .setCacheable(true)
                    .list()


EHCache.xml
Code:
   <cache
       name="org.hibernate.cache.StandardQueryCache"
       maxElementsInMemory="5000"
       eternal="false"
       timeToLiveSeconds="3600"
                    diskPersistent="false"
       overflowToDisk="true"/>
   

               <cache
       name="org.hibernate.cache.UpdateTimestampsCache"
       maxElementsInMemory="5000"
       eternal="true"
                    diskPersistent="false"
       overflowToDisk="true"/>


This query is executed in read-only transactional context and cached by StandardQueryCache. I noticed that UpdateTimestampsCache is always invalidated _after_query is cached that's why last update timestamp is always greater than query timestamp and cached resultset is always considered as not up to date. As a result query is fetched from database again.

Could you please tell me what's wrong?

Thanks in advance,
Vadim[/code]


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

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.