B
Brian Linden
I cache a ton of stuff, and my ASP.NET 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(CAFactory.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
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(CAFactory.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