Cacheing Business Objects

Discussion in 'ASP .Net' started by Thom Anderson, Nov 25, 2006.

  1. Hi, I have some business objects that are pretty simple. They get
    instantiated and have a few properties, methods, and events. The business
    objects talk to the database directly or access web services. But 99% of
    the time when they are instantiated or initially used, they access a
    database and receive a datatable.

    Can someone show me how to do the following;
    1) cache the business object in a way that it gets used by all of the users
    to the web site. I would like to store it so that each subsequental user
    does not cause the database to run the query again and I do not use up the
    web server memory. Maybe after 5 minutes it can be emptyied from the cache?
    2) cache the business object on a per user basis, so that once the users
    session starts the object gets created and doesn't have to go back to the
    server to run the query again. Unless maybe their session expires.

    Does this make sense? You can talk back to me using a foo{} fake class
    object. I will understand. I use 1.1 but will use 2.0 and maybe 3.0 next
    year.

    Thom
    Thom Anderson, Nov 25, 2006
    #1
    1. Advertising

  2. Theres a lot of articles about on SQLCachedependency, whihc should answer
    msot of your questions for you very easily.

    Try this one for a starter:
    http://www.eggheadcafe.com/articles/20060407.asp

    --
    Regards

    John Timney (MVP)
    VISIT MY WEBSITE:
    http://www.johntimney.com
    http://www.johntimney.com/blog


    "Thom Anderson" <> wrote in message
    news:u$...
    > Hi, I have some business objects that are pretty simple. They get
    > instantiated and have a few properties, methods, and events. The business
    > objects talk to the database directly or access web services. But 99% of
    > the time when they are instantiated or initially used, they access a
    > database and receive a datatable.
    >
    > Can someone show me how to do the following;
    > 1) cache the business object in a way that it gets used by all of the
    > users to the web site. I would like to store it so that each subsequental
    > user does not cause the database to run the query again and I do not use
    > up the web server memory. Maybe after 5 minutes it can be emptyied from
    > the cache?
    > 2) cache the business object on a per user basis, so that once the users
    > session starts the object gets created and doesn't have to go back to the
    > server to run the query again. Unless maybe their session expires.
    >
    > Does this make sense? You can talk back to me using a foo{} fake class
    > object. I will understand. I use 1.1 but will use 2.0 and maybe 3.0
    > next year.
    >
    > Thom
    >
    John Timney \(MVP\), Nov 26, 2006
    #2
    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. J'son
    Replies:
    0
    Views:
    360
    J'son
    Apr 12, 2005
  2. roy anderson

    Images not cacheing in 2.0?

    roy anderson, Jan 31, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    409
    roy anderson
    Feb 1, 2006
  3. Replies:
    3
    Views:
    851
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 19, 2006
  4. darrel

    Cacheing DB content

    darrel, May 30, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    680
    darrel
    May 30, 2006
  5. visu
    Replies:
    3
    Views:
    340
    Joerg Jooss
    Feb 1, 2007
Loading...

Share This Page