Connection Pooling nightmare - Timeout Expired!
-
I am having kinda the same problem as the one already mentioned here: Connection Pooling nightmare[^] This is what's happening for me. Suppose that I've got a connection pool with minimum size of 10 and maximum size of 50. I'm monitoring the connections to database using SP_WHO stored procedure as well. When the first request is made to the web site, I can see that 10 connections are created in the pool. The thing that is confusing me is that by making a few subsequent requests, new connections are added to the pool even though all of 10 initial connections are in 'sleeping' mode and 'AWAITING COMMAND' as executing SP_WHO tells me. By executing subsequent calls to database the size of pool grows until it reaches the maximum number of connections (say 50). From this point on, any attempt for connecting to database results in the following exception:
DAL: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.This is happening while there are 50 connections in the pool whose status is 'sleeping' and AWAITING COMMAND. I'm using Microsoft Enterprise Library (which I think automatically handles closing connections for me), and wherever I use DataReader, I am closing it in a finally block. Am I missing something? Please somebody help me!
_
-
I am having kinda the same problem as the one already mentioned here: Connection Pooling nightmare[^] This is what's happening for me. Suppose that I've got a connection pool with minimum size of 10 and maximum size of 50. I'm monitoring the connections to database using SP_WHO stored procedure as well. When the first request is made to the web site, I can see that 10 connections are created in the pool. The thing that is confusing me is that by making a few subsequent requests, new connections are added to the pool even though all of 10 initial connections are in 'sleeping' mode and 'AWAITING COMMAND' as executing SP_WHO tells me. By executing subsequent calls to database the size of pool grows until it reaches the maximum number of connections (say 50). From this point on, any attempt for connecting to database results in the following exception:
DAL: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.This is happening while there are 50 connections in the pool whose status is 'sleeping' and AWAITING COMMAND. I'm using Microsoft Enterprise Library (which I think automatically handles closing connections for me), and wherever I use DataReader, I am closing it in a finally block. Am I missing something? Please somebody help me!
_
Are you using your own connection pool or the built in connection pooling (that happens transparently)? Are you connecting using multiple SQL accounts (this will prevent connections being used by multiple accounts). Are you disposing of all resources? Are you actually using any of the features of the EL? (Apart from ExecuteDataSet).
Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
Alpha release: Entanglar: Transparant multiplayer framework for .Net games. -
I am having kinda the same problem as the one already mentioned here: Connection Pooling nightmare[^] This is what's happening for me. Suppose that I've got a connection pool with minimum size of 10 and maximum size of 50. I'm monitoring the connections to database using SP_WHO stored procedure as well. When the first request is made to the web site, I can see that 10 connections are created in the pool. The thing that is confusing me is that by making a few subsequent requests, new connections are added to the pool even though all of 10 initial connections are in 'sleeping' mode and 'AWAITING COMMAND' as executing SP_WHO tells me. By executing subsequent calls to database the size of pool grows until it reaches the maximum number of connections (say 50). From this point on, any attempt for connecting to database results in the following exception:
DAL: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.This is happening while there are 50 connections in the pool whose status is 'sleeping' and AWAITING COMMAND. I'm using Microsoft Enterprise Library (which I think automatically handles closing connections for me), and wherever I use DataReader, I am closing it in a finally block. Am I missing something? Please somebody help me!
_
-
Are you using your own connection pool or the built in connection pooling (that happens transparently)? Are you connecting using multiple SQL accounts (this will prevent connections being used by multiple accounts). Are you disposing of all resources? Are you actually using any of the features of the EL? (Apart from ExecuteDataSet).
Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
Alpha release: Entanglar: Transparant multiplayer framework for .Net games.I think I've found the problem. One of the data access functions was acquiring a DataReader without closing it. I don't know why I hadn't see it so far :doh: Thanks for your help though :rose:
_
-
Are you certain the connection strings are identical - even the case of individual letters matters. ANY difference will cause a new connection.
Bob Ashfield Consultants Ltd
I think I've found the problem. One of the data access functions was acquiring a DataReader without closing it. I don't know why I hadn't see it so far :doh: Thanks for your help though :rose:
_