Build connection on every page?

  • Thread starter Thread starter Stijn Verrept
  • Start date Start date
S

Stijn Verrept

When I do a Response.Redirect to load another page do I need to connect
to the database again if I need information? If so, isn't this a bad
for performance?
 
depends on the application and the amount of data you fetch with each call.
by default a pool of 100 objects is maintained.. ie if you create a
connection and then called dispose.. its returned to connection pool...
if then you do another request and if that object is not being used... it
will be served to you.. otherwise a new object is created...
if you are fetching large amounts of data with each call.. and you
frequently call same set of db calls... then it might be a better idea to
use
a: cache is the data is common but frequently used between users
b: session if the data is unique but frequently used (if you state piling up
data in session it may cause application restart to reduce memory usage)
at the end of it... you do have to do a comparitive performance in terms of
memory usuage and making the db call..

hope this helps..
 
Hermit said:
a: cache is the data is common but frequently used between users
b: session if the data is unique but frequently used (if you state
piling up data in session it may cause application restart to reduce
memory usage) at the end of it... you do have to do a comparitive
performance in terms of memory usuage and making the db call..

hope this helps..

Thanks, this sure helps. I searched MS for pooling and found a good
article about it as well.
 
Back
Top