|
|
 |
RE: FN-FORUM: Dedicated Windows Managed Server?
date posted 23rd April 2008 15:12
Ben wrote:
> Mmmm .. I'm reasonably certain from reading MS documentations that ADO
> Connection and Recordset objects - like any other ASP object - will
> automatically be destroyed when the page finishes. The only exception
> that I am aware of is if the code is explicitly storing a reference to =
> an ADO object in an Application / Session variable (which is a bad =
idea
> anyway, due to threading issues).
Colin wrote:
> Well that is where the problem lies, although ASP will automatically=20
> destroy the objects, the connection and/or recordset in SQL will =
remain=20
> open until timeout and the MS documentation doesn't cover this, that =
is=20
> why there are so many badly coded ASP sites, because this wasn't=20
> considered at the time of writing the page. It only becomes apparent=20
> once there is load on a site.
Interesting. ADO Recordsets are database-independent COM objects, =
nothing to
do with SQL Server, so I'm confident that they are automatically =
disposed of
by garbage collection as soon as they go out of scope, without using =
Close()
.. unless stored in a Session/App var.
The Connections angle is more plausible though - the ADO objects would =
be
correctly destroyed, but feasibly the clean up might not return the =
physical
connection to the pool. This still seems doubtful, though, as ADO =
manages
connection pooling and its Connection objects will have clean-up code =
that
is run as soon as it is destroyed, releasing the physical connection.
Can you point toward a reference that shows that not explicitly closing
Recordset/Connection objects at the very end of the page causes =
additional
resources to be used after the page has finished?=20
I'm always wary of taking tuning theory at face value, ever since =
applying
the MSDN tip on TypeLibs, then finding out later that it actually
significantly reduces performance! :)
Many thanks, Ben
--
Ben Johnson, Neogic Web Solutions
// design . development . managed hosting
w | http://www.neogic.com
t | +44 (0)1242 808 262
e | [EMAIL REMOVED]
=20
|
 |
|