ASP.Net 1.1 Application Object & ADO.Net DataSet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

I have a VB.NET/ASP.NET application that uses some common data throughout.
Now what I would like to do is instead of hitting the database every time to
fetch back two dataset of 5 rows 2 cols I would like to use the application
object to store these 2 dataset. I would like to know if this is advisable
and will there be any performance issues?

Thanks
Msuk
 
If the data does not change often, caching the data once for the application
is a good idea. If the data does change, but not for a session, then caching
for session is a good idea. I employ the technique regularly, as fetching
the same result set over and over is NOT a wise idea, unless it is changing
some how.

Performance issues? Provided you are not storing huge chunks of the database
in memory (or worse in memory for every session), you will find that the
issue is it performs much better than pulling the data every time.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
This will be fine. Normally you would want to use a session variable for
that.

Eliyahu
 
Hi,

Thanks for your help. I am now storing the data in the application object
that is loaded on the by Application_Start event in the global.asax

As I am testing my website I am occasionally changing the data in my
database then stop/starting my website but the application object is not
refreshing with the new data from the database. The only way I have found to
perform a refresh is by stop/starting the IIS box. Now in my production
environment this won’t be possible as I my site will be running with many
others so how can I perform a refresh of data.

Thanks
 
Hi,

The only reason I am using the application object is because it is simply
holding lookup data that will be common for every user but there could be a
requirement to change the lookup data maybe once in the year. On my
productions servers I will not be able to stop/restart iis so would a session
object be better? Is there not a way to clear out the application object for
my particular site.

Thanks
Msuk
 
Is there any particular reason you are using an application object rather
than a session variable?

Eliyahu
 
Back
Top