473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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.Inse rt("MyObj1",myD ataTable1,..... ....., AddressOf
OnItemRemoval)

Page.Cache.Inse rt("MyObj2",myD ataTable2,..... ....., AddressOf
OnItemRemoval)

Page.Cache.Inse rt("MyObj3",myD ataTable3,..... ....., AddressOf
OnItemRemoval)
Is there a way to detect in the 'OnItemRemoval' sub
which object has been removed?
Dec 7 '06 #1
2 1191
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.itw rote in message
news:1s******** *************** *********@4ax.c om...
>I insert few objects in the Cache
and
use a callback to be notified of their removal

in this way:

Page.Cache.Inse rt("MyObj1",myD ataTable1,..... ....., AddressOf
OnItemRemoval)

Page.Cache.Inse rt("MyObj2",myD ataTable2,..... ....., AddressOf
OnItemRemoval)

Page.Cache.Inse rt("MyObj3",myD ataTable3,..... ....., 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("myCac hedDataViev")
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
1520
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 referenced. The type of the data must be a Python dict (comes from an external source). Here's what I've got so far: import time
6
24549
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 = new usbdetect();
1
3183
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 well until the XML file is changed. The cached item is being removed as I would expect, but the remove callback is not firing at all, hence a NullReferenceException is being raised when I try to access the cache object. Please see code snippet...
4
5367
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 a lock using code like below (just typed this in); Cache thisCache = HttpContext.Current.Cache lock(thisCache)
1
2863
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 it needs to remove the object to free up memory. (If my understanding so far is wrong, please clarify) What I'd like to know is that if I place an object into the Cache with a sliding expiration - is it possible/likely that the system will...
3
1275
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 file however the collection is cleared after about a minute even though it is not removed from the cache. If I save the dataset on the cache it remains there indefinately. I can resue the collection many times before it is cleared. The xml file is...
2
1985
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 exception saying that ViewState was invalid. I suspect it has something to do with cache expiration time. Can I control its expiration time from within my web.config? Or anyhow? Couldn't find anything related in web or machine config files or...
6
1990
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 ) { HttpContext.Current.Cache = GetCategoriesFromDB(); } return (DataView)HttpContext.Current.Cache;}
2
2623
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
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.