Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: ADO Open and Close - how often


Message #1 by "Jeff Benson" <Jeffrey_W_Benson@K...> on Fri, 27 Sep 2002 21:57:02
Here is a good article on the subject:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html
/pooling2.asp

Make sure you get the whole link on one line.

Also, a non programmatic solution would be to go to the
control panel of each machine, and enable it from
your ODBC administrator.

Cardyin

------------------------------------------
Cardyin Kim
C/S & Web Development Analyst
San Antonio Community Hospital
Upland, CA
ckim@s...          (xxx)xxx-xxxx
------------------------------------------

-----Original Message-----
From: Mark Warner [mailto:Mark@S...] 
Sent: Monday, September 30, 2002 8:35 AM
To: professional vb
Subject: [pro_vb] RE: ADO Open and Close - how often

Hi Guys

How does connection pooling work and how does one make it happen?

Kind regards
Mark Warner
SPOTLIGHT INTERACTIVE (PTY) LTD
"Planning for Financial Excellence"
Tel : +xx xx xxxxxxx
Fax : +xx xx xxxxxxx
Email : mark@s...
<mailto:mark@s...>

Warning:Any unauthorised use or interception of this email is illegal. If
this email is not intended for you, you may not copy, distribute or disclose
the contents to anyone. Save for bona fide company matters, Spotlight
Interactive does not accept any responsibility for the opinions expressed in
this email.



-----Original Message-----
From: Kim, Cardyin [mailto:CKim@s...]
Sent: 30 September 2002 05:33
To: professional vb
Subject: [pro_vb] RE: ADO Open and Close - how often


I think that others have made the point clear...

Donald is correct in his statement that recordsets
should be closed at soon as they are not needed
anymore.

In terms of the connection, it really does depend
upon your situation.  If you know that the company
you are writing for will forever and always have
less than 20 users of your software, then you have
the luxury of keeping your connection open
throughout the lifetime of your program.

In the case of my situation, this is completely
different.  I may write a program that at first
may have only 10 users, but later on, this program
may expand to 50 users or more.  Considering it
takes about 2k of memory on the server to
maintain these connections, this is not too bad.

But...add on to this the fact that I have about 
15 different programs with at least 10 users on 
each program, you can see how quickly
one program choice can impact my data server.

In our shop here scalability is quite an
important issue, thus we try and open and close
our connections where appropriate for each
transaction.  

We also enable connection pooling on all of our 
connections to MSSQL.  This allow for one or many
different connection objects to actually use
or share the same connection to the database.

Another benefit of this process is the
fact that when your program "closes" the last
connection the database the OS will actually 
keep this connection open for a pre-set amount of 
time (usually 60 seconds to 2 minutes), just in case
you decide to open the same connection to the
database again within the timeout period.

If you happen to use the same connection again,
the OS will simply resume the use of the
underlying connection without establishing
a new connection to the database.

This is part of the reason why it seem to take
much longer to initially open a connection
to the database, but subsequent access
attempts are much quicker.

I guess that's it.  I hope this helps.

Cardyin

------------------------------------------
Cardyin Kim
C/S & Web Development Analyst
San Antonio Community Hospital
Upland, CA
ckim@s...          (xxx)xxx-xxxx
------------------------------------------



---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills 
from Visual Basic 6 to C#, the language of choice 
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059



---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills 
from Visual Basic 6 to C#, the language of choice 
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059

to unsubscribe send a blank email to ..

  Return to Index