Re: Question about objects in Cache

From: Scott Allen (bitmask_at_[nospam)
Date: 10/07/04


Date: Wed, 06 Oct 2004 22:29:13 -0400

By any chance are you using out of processes session state
persistance? (i.e. using the session state service in another process
or using SQL Server?). If so, you are describing the exact behavior.

I was assuming InProc session state, please accept humble apologies if
I caused confusion.

--
Scott
http://www.OdeToCode.com/
On Wed, 6 Oct 2004 20:23:42 -0400, "Joe Fallon"
<jfallon1@nospamtwcny.rr.com> wrote:
>I am just starting to implement this so the answer to your question is no.
>The relevant code was posted in my last message.
>
>I always call the function GetItemFromCache from my .aspx page code behind.
>
>As you can see, the function checks the cache for the object and if it
>exists, it returns it.
>If it does not exist, it creates a new object.
>
>Other tests I conducted (changing default values) show that the object is
>always being pulled from cache because the new defaults are not present
>until I invalidate the cache.
>(BTW - I use DB cache invalidation dependency to do this in ASP.Net 1.1 -
>which is really slick. It is supported natively in v 2.0.)
>
>My current theory is that my class has to be serializable to be stored in
>Session (or cache) so I wonder if the cache or session methods return the
>serialized values each time the object is retireved.
>This would validate what I am seeing. The instance in the .aspx form is
>filled with the serialized members from the object in cache, so changes to
>the object in the code behind never appear in the cache object (unless the
>objec is manually added to the cahce which I avoid, since at that time it is
>user specific.)