How 'expensive' are sql connections?

  • Thread starter Thread starter Paul W
  • Start date Start date
P

Paul W

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.
 
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
 

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

Back
Top