Build connection on every page?

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?
 
H

Hermit Dave

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..
 
S

Stijn Verrept

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,166
Latest member
DollyBff32
Top