Results 1 to 3 of 3

Thread: Configuring caching (attributes and/or xml)

  1. #1
    Join Date
    Apr 2011
    Posts
    55

    Default Configuring caching (attributes and/or xml)

    Hi,

    I am reading the documentation about caching here http://www.springframework.net/doc-l...t-library.html and I'm a bit confused, so I just want to make sure I have understood it correctly.

    If you use the xml as given in the example, ie:

    Code:
    <object" id="CacheAspect" type="Spring.Aspects.Cache.CacheAspect, Spring.Aop"/>
    
    <object id="AspNetCache" type="Spring.Caching.AspNetCache, Spring.Web">
      <property name="SlidingExpiration" value="true"/>
      <property name="Priority" value="Low"/>
      <property name="TimeToLive" value="00:02:00"/>
    </object>
    
    <!-- Apply aspects to DAOs -->
    <object type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop">
      <property name="ObjectNames">
        <list>
          <value>*Dao</value>
        </list>
      </property>
      <property name="InterceptorNames">
        <list>
          <value>CacheAspect</value>
        </list>
      </property>
    </object>
    Does this mean the container will then look for all objects matched by *Dao that are also marked with [CacheResult("AspNetCache", "whatever..")] and apply the caching advice to them?

    ie, it is never enough to just mark the method with the CacheResult attribute, you also need to set up the ObjectNameAutoProxyCreator as above?

    Just making sure

    regards,
    Jordan.

  2. #2
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,407

    Default

    You got it!

    - Bruno
    My english is as poor as my taylor is rich

  3. #3
    Join Date
    Apr 2011
    Posts
    55

    Default

    Quote Originally Posted by Bruno Baia View Post
    You got it!
    Cool. Thanks Bruno.

Posting Permissions

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