Forum Moderators: open

Message Too Old, No Replies

"max pool size was reached" problem again!

         

Vladi

1:55 pm on Nov 20, 2003 (gmt 0)

10+ Year Member



Hello everybody!
I realize that the problem, I will ask for solution of, has been posted here once, but none of the replies would actually solve it. So I will try again – there is one project, which was developed in VS2002 and worked fine, no problems were ever encountered. Then it was transferred to new VS2003, rebuilt successfully but, after one page makes 2 – 4 requests to the DB on MSSQL Server 2000 SP3 I`m receiving an error like:

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.

All connections are explicitly closed by calling .Close method, and then they are disposed by calling .Dispose method, and, finally, set to Nothing. The thing is that, this happens even for 1 user – me, sitting on the development server (or development workstation), I`m the only user who makes any connections, and I`m executing 1 SQL stored procedure call per 1 connection opening, full closing-disposing-nothining block. All procedures are simple selects or inserts, which execute in no time. Time span between those actions is quite sufficient for the server to understand that I`m the only user, and that connection attributes have not changed, so it should be pooled. Nevertheless after making 2 – 4 runs to the database and looking into “SQL Server --> Current Activity --> Process info” I see 100 items long list of connections assigned to me.
Well I`ve tried to give as full problem description as possible, please ask me if I`ve forgotten something.

Vladi

2:12 pm on Nov 20, 2003 (gmt 0)

10+ Year Member



Yep, and I forgot to tell, that I do not use DataReaders, everything is done by creating SqlConnection, SqlCommand, SqlDataAdapter objects and filling DataTable object.

mattglet

2:35 pm on Nov 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vladi-

much to your dismay, something is not happening the way you describe it. if you're finding 100 connections open after only 2-4 trips to the DB, something just ain't right.

as a short term fix, up your max connection pool setting in your web.config, and then walk away from your code for a day, and come back. search absolutely everything for possible connections that stay open.

also, i would do some research on the web regarding garbage disposal, and the proper techniques of doing so. maybe you're missing something?

-Matt