HighTechTalks DotNet Forums  

Cache Expriation Question

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss Cache Expriation Question in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Brian Linden
 
Posts: n/a

Default Cache Expriation Question - 11-15-2004 , 03:37 PM






I cache a ton of stuff, and my application works great....but......

When I am stress testing it I'll get the "Object reference not set to an
instance of an object"
every once in a while...

It tends to happen when the cache is expired.....
I do a lot testing to make sure that it actually returns the object out of
cache...
I insure that it is a valid object, then when I try to use it I get that
error.

My question is this: When get something out of cache:

Return
CType(System.Web.HttpContext.Current.Cache.Get(CAF actory.Conts.CACHE_MANAGER
), CAManager)

I believe this returns a reference to the object, so in the instant that I
return the correct reference and I am about to use it, it expires....so the
object doesn't exist anymore?

Am I thinking about this correctly? Should I test for this all the time?

If not isnothing(object) then object.Function()

What kind of performance impact would this have?
Is the "IsNothing()" function expensive?

- Brian



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.