ADO leaving Db connection open for duration of session

  • Thread starter Shawn H. Mesiatowsky
  • Start date
S

Shawn H. Mesiatowsky

I am writing a web app that is very Database intensive.. I have to open and
close db connections all over the place. I was wondering if there is any
reason not to open the db connection in the session_start event, so the
connection is availbale for the entire seesion?
 
B

Brock Allen

I'd advise against this approach as it leave your open connection idle most
of the time it's left open. Open the connection, use it, then close it. This
releases the connection as soon as possible, and since connections are pooled
then someone else in the application can use the same connection once you're
done with it. This will result in less wasted resources.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top