G
Guest
I'm getting the error message so many others have reported. I.e.
"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've read many posts on responses on the subject. The responses all seem to boil down to "you're leaking connections somehow." If I have read the documentation correctly, then I don't believe that is my problem, and here is what I've done to prove it to myself
I'm using Windows 2000 Server, SQL Server 2000 Developer's Edition, and Visual Studio.NET 2003. I'm completely up to date on all service packs for everything (except possibly if there's something newer than SP3 for SQL Server)
- I created a new blank Web Form. I used drag-and-drop in the Designer to add a sqlDataAdapter. In there, I selected for it to generate SQL statements, and I constructed a select statement that does "select top 1 * from requests where system_id>@system_id order by system_id". This process resulted in automatic generation of a sqlConnection object that also appears in Designer
- The connection is to a local SQL Server database
- I then used drag-and-drop to add a DataSet object to my form. I chose a typed dataset that was already part of my project, that was also generated by VS.NET
- I used drag-and-drop to add 4 server controls to my form - 3 labels and a button. The labels are databound to 3 columns in the dataset (again, all done visually - no coding so far). I created NO server-side handler for the button, so when you click it it just runs the Page_Load method and returns
- In the Page_Load method, I put in this code
if ( !IsPostBack
sqlDataAdapter1.SelectCommand.Parameters["@system_id"].Value = 0
els
sqlDataAdapter1.SelectCommand.Parameters["@system_id"].Value = lblSystemId.Text
sqlDataAdapter1.Fill( dsRequestTest1 )
DataBind()
The effect of this code is simply to have the page display the first record in the table when the page is first displayed. Each time I click the button on the page, it displays the next record and subsequent records from the database
Those 6 lines of code are the ONLY code I have added to this page
- When I run this page, I can click the button on the page 99 times and see the first 100 records in the table. When I click it the 100th time, I get the error
- I edited my sqlConnection object's connection string and added "max pool size=3". Now when I run it, I see the first 3 records, then get the error
- My understanding is that the sqlDataAdapter.Fill method opens and closes the sqlConnection itself, so I don't have to do an explicit Close. However, I tried it just to see what would happen. After the call to Fill(), I added these two lines
sqlConnection1.Close()
sqlDataAdapter1.SelectCommand.Connection.Close()
I still get the exact same behavior
- Also, I have tried using PerfMon to monitor the pooled connections in use, under the .NET CLR Data section of counters. It never shows any in use. The connection pool count goes from 0 to 1, but the pooled and unpooled connections in use stays at 0. This is for _global and all other instances of the counters
Help?!
"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've read many posts on responses on the subject. The responses all seem to boil down to "you're leaking connections somehow." If I have read the documentation correctly, then I don't believe that is my problem, and here is what I've done to prove it to myself
I'm using Windows 2000 Server, SQL Server 2000 Developer's Edition, and Visual Studio.NET 2003. I'm completely up to date on all service packs for everything (except possibly if there's something newer than SP3 for SQL Server)
- I created a new blank Web Form. I used drag-and-drop in the Designer to add a sqlDataAdapter. In there, I selected for it to generate SQL statements, and I constructed a select statement that does "select top 1 * from requests where system_id>@system_id order by system_id". This process resulted in automatic generation of a sqlConnection object that also appears in Designer
- The connection is to a local SQL Server database
- I then used drag-and-drop to add a DataSet object to my form. I chose a typed dataset that was already part of my project, that was also generated by VS.NET
- I used drag-and-drop to add 4 server controls to my form - 3 labels and a button. The labels are databound to 3 columns in the dataset (again, all done visually - no coding so far). I created NO server-side handler for the button, so when you click it it just runs the Page_Load method and returns
- In the Page_Load method, I put in this code
if ( !IsPostBack
sqlDataAdapter1.SelectCommand.Parameters["@system_id"].Value = 0
els
sqlDataAdapter1.SelectCommand.Parameters["@system_id"].Value = lblSystemId.Text
sqlDataAdapter1.Fill( dsRequestTest1 )
DataBind()
The effect of this code is simply to have the page display the first record in the table when the page is first displayed. Each time I click the button on the page, it displays the next record and subsequent records from the database
Those 6 lines of code are the ONLY code I have added to this page
- When I run this page, I can click the button on the page 99 times and see the first 100 records in the table. When I click it the 100th time, I get the error
- I edited my sqlConnection object's connection string and added "max pool size=3". Now when I run it, I see the first 3 records, then get the error
- My understanding is that the sqlDataAdapter.Fill method opens and closes the sqlConnection itself, so I don't have to do an explicit Close. However, I tried it just to see what would happen. After the call to Fill(), I added these two lines
sqlConnection1.Close()
sqlDataAdapter1.SelectCommand.Connection.Close()
I still get the exact same behavior
- Also, I have tried using PerfMon to monitor the pooled connections in use, under the .NET CLR Data section of counters. It never shows any in use. The connection pool count goes from 0 to 1, but the pooled and unpooled connections in use stays at 0. This is for _global and all other instances of the counters
Help?!