473,378 Members | 1,417 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,378 software developers and data experts.

[CACHE] detect removed object

teo
I insert few objects in the Cache
and
use a callback to be notified of their removal

in this way:

Page.Cache.Insert("MyObj1",myDataTable1,.......... , AddressOf
OnItemRemoval)

Page.Cache.Insert("MyObj2",myDataTable2,.......... , AddressOf
OnItemRemoval)

Page.Cache.Insert("MyObj3",myDataTable3,.......... , AddressOf
OnItemRemoval)
Is there a way to detect in the 'OnItemRemoval' sub
which object has been removed?
Dec 7 '06 #1
2 1176
create a dummy file and invalida the cache when a file is changed.
When updating the source of the cache update the file as well

--
Regards
Sheng Jiang
Microsoft MVP in Visual C++
"teo" <te*@inwind.itwrote in message
news:1s********************************@4ax.com...
>I insert few objects in the Cache
and
use a callback to be notified of their removal

in this way:

Page.Cache.Insert("MyObj1",myDataTable1,.......... , AddressOf
OnItemRemoval)

Page.Cache.Insert("MyObj2",myDataTable2,.......... , AddressOf
OnItemRemoval)

Page.Cache.Insert("MyObj3",myDataTable3,.......... , AddressOf
OnItemRemoval)
Is there a way to detect in the 'OnItemRemoval' sub
which object has been removed?

Dec 7 '06 #2
teo
now

on my pc, in the developing enviroment, the callback is
always fired and the reinsertion always happens

but

on the web site
it is not always fired
(and obviously no reinsertion can happen)
or
it is fired, but only few object (I have 5 object ) are reinserted
and in example when I try
myDataView = Me.Cache("myCachedDataViev")
sometimes I get Nothing

so there is an odd problem with
my aspx page,the IIS 6, timing, Win2000 (or 2003)...

notes:

no traffic during these tests (it's night)
no heavy elaborations performed

my callback routine is on the .aspx page
and not in a module, could be this the problem?
Dec 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
6
by: sanjana | last post by:
hi i wanna detect if a anything is connected to the usb port I am using system.management class for tht purpose this is my code class usbdetect { public static void Main() { usbdetect we =...
1
by: Glenn | last post by:
Hi, I have a config XML file that I am using from the application cache. I have configured the entry with a remove callback to re-populate cache automatically when the XML file changes. All is...
4
by: Mat | last post by:
Hi, I've stumbled onto a problem when using the caching object in ASP.Net. I'm placing a static dataset to the cache as the data only changes once a day. Whilst writing to the cache I'm using...
1
by: Guadala Harry | last post by:
AFAIK, when placing an object into the Cache with no special instructions (no dependencies, sliding expirations, hard expirations, etc), it will just sit there in the Cache until the system decides...
3
by: Alex | last post by:
Hi I am opening an xml file into a dataset and then converting it to a namevaluecollection and then saving the collection in the cache for use later. The cache dependency is set to the xml...
2
by: Kikoz | last post by:
Hi all. I keep my ViewState in server's cache. Works fine except when user leaves the page opened for a long time (2 hours or so). Then if he/she tries to post it back the server throws an...
6
by: Charts | last post by:
I used HttpContext.Current.Cache To cache data from database. The code is like that. public static DataView GetCategories() { if ( HttpContext.Current.Cache == null ) {...
2
by: Enosh Chang | last post by:
Hi all: I want to use System.Web.Caching.Cache in my web application, but I want to know the lifecycle of Cache (depending on Page, Session or Application ...). Thanks! Enosh
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.