Re: Cache variable suddenly = null
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 02/15/05
- Next message: Steve: "Automatic windows authentication login"
- Previous message: Corno: "runtime determination of authorization"
- In reply to: Paul Glavich [MVP ASP.NET]: "Re: Cache variable suddenly = null"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 15 Feb 2005 12:47:27 -0600
Also, if you want to be notified when something gets removed from the cache,
attach the appropriate delegate so that you get called back when it happens.
You can then find out when and why the item got ejected and reinsert it back
into the cache if you need to.
Joe K.
"Paul Glavich [MVP ASP.NET]" <glav@aspalliane.com-NOSPAM> wrote in message
news:e3FgLq1EFHA.3244@TK2MSFTNGP15.phx.gbl...
> Any items stored in the cache are "volatile" and can be removed by the
> system. Using the insert method you describe below, inserts the cached
> item
> with a default priority. The default being "Normal". The MSDN docs explain
> this as.
>
> "Cache items with this priority level are likely to be deleted from the
> cache as the server frees system memory only after those items with Low or
> BelowNormal priority. This is the default."
>
> As a best practice, never assume a cached item exists. Always check for
> NULL
> first and re-insert into the cache if it is NULL if thats your want.
> --
>
> - Paul Glavich
> ASP.NET MVP
> ASPInsider (www.aspinsiders.com)
>
>
> "bayam" <bayam@discussions.microsoft.com> wrote in message
> news:F6DA5AB2-F184-4291-A061-0150D1718597@microsoft.com...
>> I have a web application that inserts several enumerated lists into the
> Cache
>> on the Initialize event of global.asax:
>>
>> Cache _cache = Context.Cache;
>> _cache.Insert("Countries", htCountries);
>>
>> Sometime last night, the cached variable htCountries started to return a
>> null value, causing our code to crash. Nothing in the code assigns this
>> variable to null. Restarting the applicaton fixed the problem. (This
>> particular code has been around for 3 months, and this error has never
>> occurred before.)
>>
>> Is there a know security exploit of the .NET Cache object that would
>> allow
> a
>> hacker to do this?
>
>
- Next message: Steve: "Automatic windows authentication login"
- Previous message: Corno: "runtime determination of authorization"
- In reply to: Paul Glavich [MVP ASP.NET]: "Re: Cache variable suddenly = null"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|