<newbie> using cache when objects in cache is modified

Discussion in 'ASP .Net' started by Jeff, Oct 16, 2008.

  1. Jeff

    Jeff Guest

    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?
    Jeff, Oct 16, 2008
    #1
    1. Advertising

  2. Jeff

    Jeff Guest

    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?
    Jeff, Oct 16, 2008
    #2
    1. Advertising

  3. Jeff

    Jeff Guest

    "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?
    Jeff, Oct 16, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roshawn Dawson

    Using If-Modified-Since Http Header

    Roshawn Dawson, Nov 13, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    7,271
    Joerg Jooss
    Nov 14, 2005
  2. 7stud
    Replies:
    11
    Views:
    688
    Dennis Lee Bieber
    Mar 20, 2007
  3. Sameer
    Replies:
    6
    Views:
    329
  4. Attila.Iskander
    Replies:
    14
    Views:
    654
    Adrienne Boswell
    Sep 22, 2011
  5. Yaron Cohen
    Replies:
    0
    Views:
    326
    Yaron Cohen
    Nov 19, 2003
Loading...

Share This Page