Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ADO.NET / VB.net connection pooling

Author  Topic 

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-01-06 : 14:08:21
Does anyone have some samples or links to samples of known working connection pooling code? The code that I have doesn't seem to be pooling connections.


Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>

saglamtimur
Yak Posting Veteran

91 Posts

Posted - 2004-01-06 : 14:55:10
server=(local);uid=bla;pwd=something;database=blabla;max pool size=50

I am using this string and it seems working.

For more information about connection pooling and Performance Counters for Connection Pooling you may have a look at this article;

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

Regards
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2004-01-07 : 02:06:36
Michael, does each connection use a different connection string? Connections with slightly different attributes might not be reused by the pooling mechanism.

OS
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-01-07 : 02:16:21
All of the connections in question use the exact same cnn string. As far as I can tell, I think it has something to do with the way I'm passing connections and connection strings around between a app to a dll and from Base class to derived class (I think that's the right term).

What I might need to do is when my DLL gets the connection, instead of doing a .Open on the connection, using it, and then doing a .Close, just create a NEW() connection, which might then take advantage of Cnn pooling. Something to try.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -