There was a bug in that version of the library. Also please use our bug tracker and email list linked off of http://code.google.com/p/ehcache-spring-annotations/ to get a much more prompt response. Nick and I only check these forums periodically.
Printable View
There was a bug in that version of the library. Also please use our bug tracker and email list linked off of http://code.google.com/p/ehcache-spring-annotations/ to get a much more prompt response. Nick and I only check these forums periodically.
Hello All,
I have done enough searching for my issue related to declarative caching services using Spring but had no luck.
Based on the article [http://www.oracle.com/technology/pub...caching3.html] I have configured my Spring beans to use coherence declaratively. Adopting pre-bean configuration approach, my service calls a dao and which in-turn calls the target bean.
My App context has following entries:
<bean id="entityCacheProvider" class="org.springmodules.cache.provider.tangosol.C oherenceFacade" />
<coherence:config failQuietly="true" serializableFactory="XSTREAM"/>
<bean id="entityrDaoTarget" class="com.abc.hibernate.entityDaoImpl">
<property name="sessionFactory" ref="sessionFactoryEntity"/>
</bean>
<coherence:proxy id="entityDao" refId="entityDaoTarget">
<coherence:caching methodName="findEntityQuery" cacheName="entityQueryCache" />
</coherence:proxy>
<bean id="entityService" class="com.service.entity.entityServiceImpl">
<property name="entityDao" ref="entityDao"/>
</bean>
I have tested these configuration in two ways:
1) I am loading this context in JUnit and testing method findEntityQuery(Map, Map) in service layer (which calls dao findEntityQuery(Map,Map) method), it is caching properly. My test case is very simple, I am calling findEntityQuery(Map, Map) in a loop, so first time it fires queries to retrieve object but rest of the iterations it uses directly from the cache.
2) My problem is, when I test this configuration through a web application. I am passing same parameters to findEntityQuery(Map, Map) every time but each time it fires query instead of using from cache. Application architecture is like ejb layer -> service layer-> dao layer
In above both test case I am querying database for the same set of parameters every time but with JUnit it works but webapp it does not.
In fact, I tried other approaches also described on above article, but it just does not work. Please note I have not done any other changes in config xml or override xml files, I have just followed steps in the article.
Please not the method I am trying to cache is having two Map parameters not just primitives.
I would appreciate your time.
Does spring module declarative caching work only for method with primitives parameters? My problem I think is because the method I am trying to cache has two Map as method signatures. Please advice. Thanks!