Cacheing Business Objects  
Author Message
Thom Anderson





PostPosted: 2006-11-26 3:54:07 Top

dotnet-framework-aspnet, Cacheing Business Objects 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)





PostPosted: 2006-11-27 5:35:00 Top

dotnet-framework-aspnet >> Cacheing Business Objects 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

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


"Thom Anderson" <email***@***.com> wrote in message
news:u$email***@***.com...
> 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
>