Connecting Tech Pros Worldwide Forums | Help | Site Map

How 'expensive' are sql connections?

Paul W
Guest
 
Posts: n/a
#1: Nov 21 '05
Hi - I'm developing my first major asp.net app.

How much work is it worth doing to share a sql connection between various
modules of code?

Obviously, the easiest (for me!) way is to have a 'local' connection
established by each module of code (function etc.). But this might mean that
to serve one page it creates 3 or 4 separate connections.

Can anybody give any assesment of performance costs (with connection pooling
enabled?).

Thanks,

Paul.



Cor Ligthert
Guest
 
Posts: n/a
#2: Nov 21 '05

re: How 'expensive' are sql connections?


Paul,

The adonet newsgroup was in past full of messages that it was a bad habbit
(because of connection pooling) to let a connection exist in an application
longer than that it was needed for the reading or updating or whatever. The
best is to create and *dispose* it every time. (The dispose is in this case
needed, where in most cases close is enough, that has to do with the
connection pooling, when there can be more than hundred connection in one
time).

You ask to share the connections over a complete ASPNET application (where
more clients are involved).

I hope you don't mind I answer it like this and not your actual question.

(This is for VSNet 2002/2003, the connection change for 2005 however I have
never read that that involves this creating and closing).

I hope this helps anyhow something?

Cor


Closed Thread