W
Willy Yao
We have the database connection pooling problem with our asp.net program.
In order to test this, I wrote the following simple test code one one aspx
page, and then load testing this page with 200 users
I could see the database connection went up to maximum 100 on my database,
then gave error message saying connection timeout, maximum pooling reached
etc.
it seems connection pooling doesn't work at all for datareader. I have
seen people posted the same problem, but never saw any definite solution to
it. I suspect it is a bug in .NET.
I tried used dataset. It seems that dataset doesn't have this problem.
Any thought on this?
Dim oCnn As SqlConnection
Dim oData As SqlDataReader
Dim oCmd As SqlCommand
oCnn = New SqlConnection("server=hostname;database=test;user id=user1;
password=pwd1;")
oCnn.Open()
oCmd = New SqlCommand("select * from CLIENT", oCnn)
oData = oCmd.ExecuteReader(CommandBehavior.CloseConnection)
oData.Read()
Response.Write(oData(0))
oData.Close()
oCnn.Close()
oCmd = Nothing
oData = Nothing
oCnn = Nothing
In order to test this, I wrote the following simple test code one one aspx
page, and then load testing this page with 200 users
I could see the database connection went up to maximum 100 on my database,
then gave error message saying connection timeout, maximum pooling reached
etc.
it seems connection pooling doesn't work at all for datareader. I have
seen people posted the same problem, but never saw any definite solution to
it. I suspect it is a bug in .NET.
I tried used dataset. It seems that dataset doesn't have this problem.
Any thought on this?
Dim oCnn As SqlConnection
Dim oData As SqlDataReader
Dim oCmd As SqlCommand
oCnn = New SqlConnection("server=hostname;database=test;user id=user1;
password=pwd1;")
oCnn.Open()
oCmd = New SqlCommand("select * from CLIENT", oCnn)
oData = oCmd.ExecuteReader(CommandBehavior.CloseConnection)
oData.Read()
Response.Write(oData(0))
oData.Close()
oCnn.Close()
oCmd = Nothing
oData = Nothing
oCnn = Nothing