Connection pooling questions

F

fniles

I am using VB.NET 2005 and SQL Server.
I would like to test how many connections I can have open in the connection
pooling.

1. In the connection string if I do not include "Max Pool Size=200", it can
open around 146 connections before it gave me the error "Timeout expired.
The timeout period elapsed prior to obtaining a connection from the pool.
This may have occurred because all pooled connections were in use and max
pool size was reached." I thought the default maximum pool size is 100, how
come I can open > 100 connections ?

2. When I include "Max Pool Size=200", it can open more than 200
connections, sometimes it can open > 400 connections. Why can it open > 200
connections when I set "Max Pool Size=200" ?
What is the maximum pool size that I can set it to ?

3. I read that "If the maximum pool size has been reached and no usable
connection is available, the request is queued.". Is this also true for MS
Access database ?

Dim adoCon As SqlClient.SqlConnection = Nothing
Dim swError As StreamWriter
Dim x As Int16

Try
For x = 1 To 500
adoCon = New SqlClient.SqlConnection
With adoCon
.ConnectionString = "Data Source={My_IP_Address};Initial
Catalog=myDB;User ID={myID};Password={myPwd};Max Pool Size=200"
.Open()
End With
Next
Catch ex As Exception
'error "Timeout expired. The timeout period elapsed prior to
obtaining a connection from the pool.
'This may have occurred because all pooled connections were in
use and max pool size was reached."
swError = New StreamWriter(Application.StartupPath &
"\ErrorLog" & Date.Now.ToString("MMddyy") & ".txt", True)
swError.WriteLine(Now & " Button2_Click - error = " &
ex.Message & " x = " & x)
swError.Close()
swError = Nothing
End Try
 
G

Guest

I am using VB.NET 2005 and SQL Server.
I would like to test how many connections I can have open in the
connection pooling.

Why do you need that many connections?
 

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

Top