473,324 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Items removed from cache without a reason, why? (CacheItemRemovedReason)

Hi,
I've developed a timerjob that adds a lot of XmlDocument objects to the cache of a web application.
I've used this code to add the object to the cache:

Expand|Select|Wrap|Line Numbers
  1. Cache.Insert(XMLKey, doc, dependency, System.Web.Caching.Cache.NoAbsoluteExpiration, new TimeSpan(24, 0, 0), System.Web.Caching.CacheItemPriority.Normal, onRemove);
Parameters represent the following:
XMLKey --> The cache key used to reference the object
doc --> the XmlDocument object
dependency --> the file dependency for the item to invalid the cache
System.Web.Caching.Cache.NoAbsoluteExpiration --> absolute expiration, in this case the cache should never expire
new TimeSpan(24, 0, 0) --> sliding expiration, in this case the cache should expire after 24 hours
System.Web.Caching.CacheItemPriority.Normal --> Cache item priority
onRemove --> a delegate (CacheItemRemovedCallback) called when the item is removed from the cache for any reason

I need to keep all the objects in cache until their expiration (24 hours), but they are removed automatically after one or two hours!
I use the delegate onRemove to understand the reason of this behavior. In order to do this I print out the CacheItemRemovedReason value and this is REMOVED.
On msdn I've found this about REMOVED as value of CacheItemRemovedReason property:
REMOVED --> The item is removed from the cache by a Remove method call or by an Insert method call that specified the same key.
The point is that I do not call any Insert method with the same key neither any explicit Cache.Remove() method. So I don't understand what causes the removing of all my items. :S

Any idea about this issue? Please, could anyone help me?

Thanks a lot.
Angela
Nov 2 '10 #1
0 1394

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: lawrence | last post by:
Please look at these few lines of code. You'll see that I keep echoing out the variable $name. And each time, I'm getting the correct result. But then, when it is used in an error statement, it is...
0
by: Herbert Ebberg | last post by:
Hello, I need some help - my listener crashes without reason after installing Oracle 9i on a Windows XP Prof ServicePack2. I can start the listener with lsnrctl or with the services of xp, the...
0
by: trashMan | last post by:
Hi, I've a big problem!!! The replication start and work correctly but after 10 minutes slave don't update anymore. I must do "slave stop - slave start" for restarting replication. In the...
0
by: trashMan | last post by:
After 60~120 secs the replication stopped.=20 Setting the parameter Connect-rety to 30 secs doesn't change the situation: the slave lose the connection and the replication is stopped. Massi ...
0
by: Jim Douglas | last post by:
How to do this with C# please! Can't seem to find anything or figure this out. Thanks!
0
by: Timo | last post by:
I'm trying to make a thread safe object cache without locking. The objects are cached by the id of the data dict given in __new__. Objects are removed from the cache as soon as they are no longer...
4
by: Seguros Catatumbo | last post by:
Hi guys, i am having some weird issue with an ajax page. I am designing a simple ajax calendar, because the one over yahoo is about 200kb long, and mine is 9kb and really simple. I am using...
8
by: brett | last post by:
How do I add a string to the cache so that it updates if the string source changes? CacheDependency() seems to want an absolute path. My string is a full http link. Thanks, Brett
10
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi Everybody, I'm trying to save some items in the asp.net cache, but they are removed from the cache WAY before they are supposed to (at least as I understand the documentation). I add the...
0
by: bloodsugarsuckerfish | last post by:
Hi all, I have in the ASP.NET cache a Hashtable of items. What seems to be happening,is that some of the actual entries in the hashtable are being removed, perhaps under memory pressure, when...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.