[thelist] Question about DB connections in ASP

Matthew Bernhardt bernhardt.7 at osu.edu
Thu Mar 2 08:07:58 CST 2006


Hello again,

On Thu, 02 Mar 2006 08:54:04 -0500, VOLKAN ÖZÇELİK  
<volkan.ozcelik at gmail.com> wrote:

>> Is there a performance hit to opening a connection and leaving it open
>> for an entire page, or is it better to open and then close several
>> different connection objects?
>
> However SQLServer, DB2, MySQL etc will not feel a performance hit.
> Actually for those more-database-like databases, opening and closing
> the connection several times brings up a performance hit since
> creating a Connection object is a costy operation.

Good point - I should have clarified this. The ASP pages are connecting to  
a MySQL database server running 4.0.x (not sure of the version beyond  
that).

Is there a way I can quantify how "costly" it is to create/open a  
Connection object? I can't sit down in front of either the webserver or  
the database server in this case, so I can't check things like running  
processes, memory load, etc.

> Here is what I use 99% of the time:
>
> _beginnin of page
> DBInit
> DBConnect
>
> ... do stuff ...
>
> DBDisconnect
> DBRelease
> _end of page

This is my usual structure as well - but after seeing this page code  
(which I'm inheriting from a previous developer), it occurred to me that I  
couldn't be -sure- what the best way of handling things was. I've been  
told ColdFusion does things this way by default, but didn't want to  
extrapolate across vendors.

Thanks for the input,
Matt

-- 
Matt Bernhardt, bernhardt.7 at osu.edu
Webmaster  +  Fab  Lab  Coordinator
Knowlton  School   of  Architecture
The    Ohio     State    University



More information about the thelist mailing list