On Tue, 15 Mar 2005 14:06:08 -0600, Daves <db****@simnet.is> wrote:
is it a good or bad practise to use the session_start & session_end for
opening & closing the database connection? I'd thought that on powerful
servers today the time the connection is kept locked should not matter as
scripts (especially .Net!) are now run in milliseconds?
Bad practice; as discovered elsewhere, these 2 events don't always occur
or if they do, and your session is 20 minutes, then if a user closes their
browser, the connection sits there (open) for another 19+ minutes.
ADO.NET will pool connections for you automatically, so there's no need to
do anything other than open a connection when needed and close as soon as
done.
There are some caveats to consider, though, as illustrated in this article:
http://www.ondotnet.com/pub/a/dotnet.../connpool.html
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET