I have a web application (ASP.Net V2) that fetches stuff from the database.
I've created a test project in Visual Studio 2005.
In the webtest I fetch data from some webservices that query the database.
It responds in 0.02 to 0,10 seconds for the queries in the webtest (5
queries).
When I loadtest the webtest with 1 user and no wait time I get about 40
responses, then I get the error:
--------
System.InvalidOperationException: 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.
at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
....
-----------
In my dataaccess I use "using" on the connection everywhere I can (whenever
I don't return a datareader)
When I return a datareader I use CommandBehavior.CloseConnection
And every place I fetch a datareader I use "using" on the datareader.
So why do I get the error above? Is it because the connections can't be
reused as fast as I am using them? Or must it be because I'm not closing my
connections properly (I've checked everything twice, I'll check again).
Kind Regards,
Allan Ebdrup