SQL Server Connection Pooling

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I' m using the following connection string for connectiing in SQL Server
2000 through ADO.NET:

"Persist Security Info=False; Data Source = datsourcename;User
ID=useridname; Password =passwordname;server= servename; Connect
Timeout=10;"



but when i try to execute stored procedure through ExecuteNonQuery passing
the same above connection string several times (about 300 times) the the
application dosent use the connection from the pool but every times open a
new one!!!

any idea?



tnx! bill
 
Bill said:
I' m using the following connection string for connectiing in SQL
Server 2000 through ADO.NET:

"Persist Security Info=False; Data Source = datsourcename;User
ID=useridname; Password =passwordname;server= servename; Connect
Timeout=10;"

Try removing the spaces before and after each "=".
but when i try to execute stored procedure through ExecuteNonQuery
passing the same above connection string several times (about 300
times) the the application dosent use the connection from the pool
but every times open a new one!!!

Are you closing the connection after you open it?
Which .NET Data Provider are you using?
 
Is this a Client/server application (as in Windows Forms) or an ASP.NET
application?
Each process gets its own pool. In ASP.NET, each instance of the application
shares a common pool. In Windows architectures each application gets its own
pool. If you open a new connection, the pooler compares the connection
string with existing connection strings and opens a server-side connection
if a match does not exist. If your connection string changes, it creates a
new pool. If a matching connection string is found, but it's busy (because
you have not closed the previous connection) the pooler creates a new
server-side connection.
I expect the program is not closing the connection between executions or the
string is changing.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top