Results 1 to 2 of 2

Thread: Caching Help

  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Default Caching Help

    I need help getting the caching going. It simply is not going to my custom cache provider.

    The cache provider implements the Spring.Caching.ICache interface.

    the web config looks like:
    <sectionGroup name="spring">
    <section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHan dler, Spring.Core"/>
    <section name="parsers" type="Spring.Context.Support.NamespaceParsersSecti onHandler, Spring.Core"/>
    <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
    <section name="objects" type="Spring.Context.Support.DefaultSectionHandler , Spring.Core"/>
    </sectionGroup>

    ...

    <spring>
    <parsers>
    <parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data"/>
    </parsers>
    <context>
    <resource uri="~/Config/Aspects.xml"/>

    </context>
    </spring>

    ...

    <httpModules>
    <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
    <add name="RewriteModule" type="mla.web.RewriteModule, MLAWeb3" />
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>

    The Aspect.Xml looks like:

    <objects xmlns="http://www.springframework.net">

    <!-- Cache aspect -->
    <object id="CacheAspect" type="Spring.Aspects.Cache.CacheAspect, Spring.Aop"/>
    <object id="NCache" type="mla.caching.WebCache,mla.caching"/>
    <object id="AspNetCache" type="Spring.Caching.AspNetCache, Spring.Web"/>


    <!-- Apply aspects to DAOs -->
    <object type="Spring.Aop.Framework.AutoProxy.ObjectNameAut oProxyCreator, Spring.Aop">
    <property name="ObjectNames">
    <list>
    <value>*Article</value>
    </list>
    </property>
    <property name="InterceptorNames">
    <list>
    <value>CacheAspect</value>
    </list>
    </property>
    </object>


    </objects>

    the test method in(the class named 'Article') to be cached looks like:

    [CacheResult("NCache", "'foo'", TimeToLive = "0:1:0")]
    public List<IArticleModel> SearchArticles(object paramValueSource)
    {

    return dal.SearchArticles(paramValueSource);

    }


    but it never adds to cache or gets from cache....what am i missing. Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    10

    Default

    Hi

    We use NCache too.

    We have the following in our config
    <parsers>
    <parser type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop"/>
    <parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data"/>
    <parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data"/>
    </parsers>

    And the following

    <object id="CachePointcut" type="Spring.Aspects.Cache.CacheAspect, Spring.Aop"/>

    Doubt it makes any difference but we inherited from AbstractCache rather than ICache.

    Cheers,

Posting Permissions

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