Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / February 2007

Tip: Looking for answers? Try searching our database.

.NET 2 caching problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Brook - 21 Feb 2007 14:07 GMT
Hi everyone,

I've been playing around a little with .NET 2. A tool i'm working on
produces some data in one aspx page, stores it in the cache. Subsequently, a
different page causes the data to be retrieved from the cache, updated and
reinserted with the same cache name (overwriting over the old data). Back on
my first page again, when I action the data to be output somewhere (to page
for example) the data displays as the original data, not the updated
version.

I'm not using any sliding expiration, I have an absolute point that the
cache should be emptied etc. It just appears that page 2's changes to the
cache are not reflected when seen from page 1.

If I create a new cache item in page 2 (with different key) then I can
access it fine from page 1 (thus essentially fixing the problem, or getting
around it anyway). However, i'd like to understand the behaviour.

My thoughts so far have been:
   1. a cache item is owned by the page in which it was created and can not
be edited by other pages, although it can be viewed by them - this doesnt
seem likely at all though...

   2. using the cache is perhaps not correct in my situation, although id
still like to know why i can't use it.

I hope someone can clarify a little what's going on here - please shout up
if more details are required.
thanks,
Andrew
Alvin Bruney [MVP] - 27 Feb 2007 00:33 GMT
You have a bug in your code, this behavior is not by design. However, the
cache is overkill for that type of thing, change the name from cache to
session, all the rest of the code remains the same. I assume you will have
the same issue since the big is probably in your logic.

Signature

Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley

> Hi everyone,
>
[quoted text clipped - 26 lines]
> thanks,
> Andrew

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.