CacheDependency error

Topics: Caching Application Block , General discussion
Jun 10, 2007 at 8:23 AM
Hi..
I am using Caching Application Block and i'm getting the following error in my application:
This error occured when the user surf to my site, and after 20-40 minutes after he close the browser he back to the site, and get this error:

Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Web.UI.WebControls.XmlDataSource.PopulateXmlDocument(XmlDocument document, CacheDependency& dataCacheDependency, CacheDependency& transformCacheDependency)
at System.Web.UI.WebControls.XmlDataSource.GetXmlDocument()
at System.Web.UI.WebControls.XmlHierarchicalDataSourceView.Select()
at Telerik.WebControls.RadTreeView.PerformDataBinding(IEnumerable data)
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
at System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e)
at Telerik.WebControls.RadTreeView.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


this is the way i am using the cache: code sample:
cacheManager.Add(cacheKey, cacheVal, CacheItemPriority.Normal, null, new AbsoluteTime(DateTime.Now.AddMinutes(120)));

The configuration block:
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="Cache Manager"/>
</cacheManagers>
<backingStores>
<add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2.0.0.0, Culture=neutral, PublicKeyToken=40f1ae4ef34b42dc" name="Null Storage"/>
</backingStores>
</cachingConfiguration>

I also want to use CachingServiceFailureEvent to try to catch the main error, and i looked for documention how to use that, and i couldnt find any...

Any one have any idea...
thank you...
Jun 19, 2007 at 12:54 PM
Hi,

The stack you're showing doesn't seem to be related to the Caching Block; the CacheDependency class in bold is really an ASP.NET cache class http://msdn2.microsoft.com/en-us/library/system.web.caching.cachedependency.aspx that is not referenced in EntLib's Caching Block.

You'll need to provide additional information to further diagnose the issue and determine if the Caching Block is involved in this particular failure, including the exception's description.

Regarding the CachingServiceFailureEvent, I think that is a class from EntLib 1.1 and you seem to be using 2.0. In any case, if you want to catch the error you can just add a breakpoint since you have the source.

HTH,
Fernando