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
|