<newbie> using cache when objects in cache is modified

J

Jeff

hi

asp.net 2.0

In a webpage I have a GridView displaying a collection of data. This
collection of data is a collection of objects based on a custom class. where
each object represent a record in the database..

this collection is stored in the cache so that maybe next time a trip to the
database isn't needed

If I modify data in the GridView: I have a ButtonLink in my GridView, when I
click on it a field in the database is updated.
After this update is done nothing is displayed, that's because the GridView
gets the data from the cache... Only when cache is outdated (1 hour) a full
read from database is done and a new cache is created.....

But I'm wondering if it's good practice to when a object like this is
modified to loop through the entire cache and remove the modified object and
replace it with the updated version?
 
J

Jeff

what if I instead of removing the object in cache, I just give it the new
value which was placed in the database... then I don't need to remove the
object and insert a new object....good approach?
 
J

Jeff

"what if I instead of removing the object in cache, I just give it the new
value which was placed in the database... then I don't need to remove the
object and insert a new object....good approach? "

I guess that is a bad solution. Because items are sorted based on this
column in my GridView. If I update this field then perhaps this row should
be removed from this page. because my GridView has enabled paging and this
row should be on another page after this update..... any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,961
Messages
2,570,130
Members
46,689
Latest member
liammiller

Latest Threads

Top