Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: Declarative Caching

  1. #21

    Default

    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.

  2. #22
    Join Date
    Jul 2010
    Posts
    3

    Default Declarative caching with Tangosol

    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.

  3. #23
    Join Date
    Jul 2010
    Posts
    3

    Default

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •