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. General Programming
  3. .NET (Core and Framework)
  4. Connection Pooling problem

Connection Pooling problem

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpdatabasequestion
8 Posts 4 Posters 0 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.
  • R Offline
    R Offline
    ruanr
    wrote on last edited by
    #1

    Hi... I have a problem and quite frankly I'm stumped :| One of our clients is repeatedly getting the "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." The common cause of this error is ofcourse the connection pool being exhausted, but this seems extremely unlikely - the connection keeps the default max pool count (of 100?), and the client has been unable to use this specific application since day 1. Secondly, the timeout on my connection is set to 120, but the client receives the dialog ~20 seconds after attempting to start the application. The client is also able to start the application from another computer, using the same login (which should lead to the same connection string, and hence the same connection pool). The client is able to connect to the database using other (non .net) applications on his system. I have asked him to try and start other .net apps that connect to the database in a similar fashion as mine, unfortunately the client is Chinese, and not technically minded, which makes communication very hard. Basically, I'm just looking for ideas for a line of investigation. Anyone have a clue?

    W R P 3 Replies Last reply
    0
    • R ruanr

      Hi... I have a problem and quite frankly I'm stumped :| One of our clients is repeatedly getting the "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." The common cause of this error is ofcourse the connection pool being exhausted, but this seems extremely unlikely - the connection keeps the default max pool count (of 100?), and the client has been unable to use this specific application since day 1. Secondly, the timeout on my connection is set to 120, but the client receives the dialog ~20 seconds after attempting to start the application. The client is also able to start the application from another computer, using the same login (which should lead to the same connection string, and hence the same connection pool). The client is able to connect to the database using other (non .net) applications on his system. I have asked him to try and start other .net apps that connect to the database in a similar fashion as mine, unfortunately the client is Chinese, and not technically minded, which makes communication very hard. Basically, I'm just looking for ideas for a line of investigation. Anyone have a clue?

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      I got the impression thet the application resides on the client machine and the connection pool also is located at the client. If so, does the client located application connect to the database directly? If it does, could it simply be that this client isn't able to connect to the database at all using the connection string in the application.

      The need to optimize rises from a bad design.My articles[^]

      R 1 Reply Last reply
      0
      • R ruanr

        Hi... I have a problem and quite frankly I'm stumped :| One of our clients is repeatedly getting the "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." The common cause of this error is ofcourse the connection pool being exhausted, but this seems extremely unlikely - the connection keeps the default max pool count (of 100?), and the client has been unable to use this specific application since day 1. Secondly, the timeout on my connection is set to 120, but the client receives the dialog ~20 seconds after attempting to start the application. The client is also able to start the application from another computer, using the same login (which should lead to the same connection string, and hence the same connection pool). The client is able to connect to the database using other (non .net) applications on his system. I have asked him to try and start other .net apps that connect to the database in a similar fashion as mine, unfortunately the client is Chinese, and not technically minded, which makes communication very hard. Basically, I'm just looking for ideas for a line of investigation. Anyone have a clue?

        R Offline
        R Offline
        Roger Wright
        wrote on last edited by
        #3

        Just a swag, but since only one client machine is affected, could that machine have the wrong Jet db engine installed?

        "A Journey of a Thousand Rest Stops Begins with a Single Movement"

        1 Reply Last reply
        0
        • R ruanr

          Hi... I have a problem and quite frankly I'm stumped :| One of our clients is repeatedly getting the "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." The common cause of this error is ofcourse the connection pool being exhausted, but this seems extremely unlikely - the connection keeps the default max pool count (of 100?), and the client has been unable to use this specific application since day 1. Secondly, the timeout on my connection is set to 120, but the client receives the dialog ~20 seconds after attempting to start the application. The client is also able to start the application from another computer, using the same login (which should lead to the same connection string, and hence the same connection pool). The client is able to connect to the database using other (non .net) applications on his system. I have asked him to try and start other .net apps that connect to the database in a similar fashion as mine, unfortunately the client is Chinese, and not technically minded, which makes communication very hard. Basically, I'm just looking for ideas for a line of investigation. Anyone have a clue?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          As a matter of interest, have you ensured that the connections have been disposed immediately after use? If you are acquiring connections for each database operations, it could be that the connection hasn't been closed and returned to the pool. If you're using an enterprise database server, try monitoring the connections.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          My blog | My articles | MoXAML PowerToys

          R 1 Reply Last reply
          0
          • W Wendelius

            I got the impression thet the application resides on the client machine and the connection pool also is located at the client. If so, does the client located application connect to the database directly? If it does, could it simply be that this client isn't able to connect to the database at all using the connection string in the application.

            The need to optimize rises from a bad design.My articles[^]

            R Offline
            R Offline
            ruanr
            wrote on last edited by
            #5

            That does seem to be the case. Oddly enough with a different username he gets another error (Named Pipe Error 40), but it boils down to a connection not establishing. I'm going to try to get him to set his DSN to use TCP rather than Named Pipes, but this is basically clutching at straws.

            W 1 Reply Last reply
            0
            • P Pete OHanlon

              As a matter of interest, have you ensured that the connections have been disposed immediately after use? If you are acquiring connections for each database operations, it could be that the connection hasn't been closed and returned to the pool. If you're using an enterprise database server, try monitoring the connections.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              My blog | My articles | MoXAML PowerToys

              R Offline
              R Offline
              ruanr
              wrote on last edited by
              #6

              I did check the connections to the server with sp_who and by reading from sysprocesses, there are no connections open with his username when he is not actively using our system, and even when he is, there are 5 or less (with a max pool size of 100) Is there a more efficient way of monitoring database connections?

              P 1 Reply Last reply
              0
              • R ruanr

                I did check the connections to the server with sp_who and by reading from sysprocesses, there are no connections open with his username when he is not actively using our system, and even when he is, there are 5 or less (with a max pool size of 100) Is there a more efficient way of monitoring database connections?

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                Yes - you can monitor connections using SQL Profiler. I have an article here[^] that might help - it's not about monitoring connections, but the basic principals are the same, all you need do is change the events you want to monitor.

                "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                My blog | My articles | MoXAML PowerToys

                1 Reply Last reply
                0
                • R ruanr

                  That does seem to be the case. Oddly enough with a different username he gets another error (Named Pipe Error 40), but it boils down to a connection not establishing. I'm going to try to get him to set his DSN to use TCP rather than Named Pipes, but this is basically clutching at straws.

                  W Offline
                  W Offline
                  Wendelius
                  wrote on last edited by
                  #8

                  In that case the pool may be exhausted since it's user specific. If after a reboot he gets the error with the original username, it may be that the connection can't be established (for example sql server isn't listening on named pipes) and if that error occurs several times the pool may be depleted. So you may have two partly different problems at the same time. Since he gets a named pipes error it's good to start resolving that by changing the protocol. After it's worked out concentrate on the connection problem (if it exists anymore).

                  The need to optimize rises from a bad design.My articles[^]

                  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