Thank you so much. I really appreciate you sharing with the Forums
A little clarification though...
Are the MethodObjectCacheKeyGenerator and ValueCacheKeyGenerator built-in
classes provided by the Spring Framework OR is it something we have to write 
i am confused by the package name com.XXX

Regards
Bansi
 

Titi Wangsa wrote:
> 
> something like this for the skeleton
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
>     <bean id="cacheManager"
>         class="
> org.springmodules.cache.provider.oscache.OsCacheManagerFactoryBean">
>         <property name="configLocation">
>             <value>classpath:oscache.properties</value>
>         </property>
>     </bean>
> 
>     <bean id="cacheProviderFacade"
>         class="org.springmodules.cache.provider.oscache.OsCacheFacade">
>         <property name="cacheManager" ref="cacheManager" />
>     </bean>
> 
>     <bean id="cacheProxyTemplate" abstract="true"
>         class="
> org.springmodules.cache.interceptor.proxy.CacheProxyFactoryBean">
>         <property name="cacheProviderFacade">
>             <ref local="cacheProviderFacade" />
>         </property>
>         <property name="cacheKeyGenerator">
>             <ref local="cacheKeyGenerator" />
>         </property>
>     </bean>
> 
>     <bean id="cacheKeyGenerator"
>         class="com.xxx.MethodObjectCacheKeyGenerator">
>     </bean>
>     <bean id="valueCacheKeyGenerator"
>         class="com.xxx.ValueCacheKeyGenerator">
>     </bean>
> </beans>
> 
> 
> and use it with
>     <bean id="positionVacancyDAO" parent="cacheProxyTemplate">
>         <property name="cachingModels">
>             <props>
>                 <prop key="findCompanies">refreshPeriod=300</prop>
>             </props>
>         </property>
>         <property name="target">
>             <ref local="positionVacancyDAOTarget" />
>         </property>
>     </bean>
> where the "positionVacancyDAOTarget" is you dao does the query to the
> database
> "findCompanies" is function call you want to cache the result
> and "refreshPeriod=300" means first call goes to the db, and for every
> call
> within 5 minutes (300 seconds), just use the cache.
> 
> i think ideally there is a transaction-proxied service that uses your
> cache-proxied dao and your jsf code calls the service.
> 
> i've asked the spring people about this, and they hinted that using
> hibernate and a secondary cache is better..
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Caching-JSF-Dropdown-Results-tf3805830.html#a10793450
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to