Connection time out due to connection pooling

  • My application works fine for approx 35 trips to SQL server and then bombs out with a time out error blaming the connetion pool max possibly having been exceeded.  100 connections! pu-lease.  I get the same error when connection pooling is turned off. I explicitly close each datareader and each connection, using try, finally blocks, so they close no matter what.  Using Performance monitor I can see the number of connections in the pools being used. only 2, and then at about the dreaded 35th trip to SQL server, I can watch the connection failure numbers grow and won't be able to connect again until I restart my app! The data entry I'm doing uses the same 3 stored procedures over and over again.  How do I find out what is wrong?  SQL Profiler only shows me what's happening after I connect, which tells me nothing about why I can't connect. Does anyone know of any tools that can help me see what the problem is?

  • From my experience the most common cause of this problem is either not closing connections or calling the Connection.Dispose() method or the DataReader.Close() method of an open DataReader from a distructor or Dispose method of your own class. Microsoft recommends that you do not call the Displose method of either object from a distructor, it causes some strange side effects. I have first hand experience of this and it took a while to solve.

    Keith

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply