-->
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: Back end changes not reflecting through query cache.
PostPosted: Fri Sep 03, 2010 4:18 am 
Newbie

Joined: Fri Sep 03, 2010 3:56 am
Posts: 1
Hi,

Problem : Caching the Query is working but if any of the data modifies at back end it is not showing in the UI.

I am using hibernate query level caching with second level cache. I have set the below two line in my hibernate xml file.
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>

I have set the cache property in xml file as well.
<class name="BuildingMaster" table="BUILDING_MASTER">
<cache usage="read-write"/>

for setting the query cache add the below lines of code.

getHibernateTemplate().setCacheQueries(true);
getHibernateTemplate().setQueryCacheRegion("Location.Building");
allBuildings=(List) getHibernateTemplate().find(SIMConstants.ALL_BUILDINGS_IN_COUNTRY, countryCode);

and also configured ehcache.xml with below entries.

<ehcache>
<diskStore path="java.io.tmpdir" />
<defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="7776000" overflowToDisk="true" />
<cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="1000" eternal="false" timeToLiveSeconds="7776000"
overflowToDisk="true"/>
<cache name="Location.Building" maxElementsInMemory="500" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="7776000" overflowToDisk="true"/>
</ehcache>

can any one's help is appriciated.

Thanks,
Kesava


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.