Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Connection Pooling nightmare - Timeout Expired!

Connection Pooling nightmare - Timeout Expired!

Scheduled Pinned Locked Moved Database
databasehelpsharepointcomtools
5 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Meysam Mahfouzi
    wrote on last edited by
    #1

    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!

    _

    M A 2 Replies Last reply
    0
    • M Meysam Mahfouzi

      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!

      _

      M Offline
      M Offline
      Mark Churchill
      wrote on last edited by
      #2

      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.

      M 1 Reply Last reply
      0
      • M Meysam Mahfouzi

        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!

        _

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • M Mark Churchill

          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.

          M Offline
          M Offline
          Meysam Mahfouzi
          wrote on last edited by
          #4

          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:

          _

          1 Reply Last reply
          0
          • A Ashfield

            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

            M Offline
            M Offline
            Meysam Mahfouzi
            wrote on last edited by
            #5

            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:

            _

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups