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. C#
  4. 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.

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.

Scheduled Pinned Locked Moved C#
csharpdatabaseoraclehelp
13 Posts 3 Posters 2 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.
  • B btsrinath

    Thanks for the reply. Your hint did not help me. This is a strange behaviour, If I connect to the same database from a desktop application developed in C# with the same connection string, it does executes the procedure. But the same tried from C# service application it hangs for a min and then throw this exception. Let me know if am doing somthing wrong... :(. I am in a pretty bad state with this exception. Srinath

    D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #4

    As a test, go into the Services manager (Start/Run Services.msc), stop your service and change the userid and password that the service runs under to your id and password. Then restart the service and see what happens.

    Dave Kreskowiak Microsoft MVP - Visual Basic

    B 1 Reply Last reply
    0
    • D Dave Kreskowiak

      As a test, go into the Services manager (Start/Run Services.msc), stop your service and change the userid and password that the service runs under to your id and password. Then restart the service and see what happens.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      B Offline
      B Offline
      btsrinath
      wrote on last edited by
      #5

      Even this did not help me. Is there any initial setup that has to be done on my system even before accessing the database from service applications ? like user creation, giving persmissions etc..etc...? Srinath

      D 1 Reply Last reply
      0
      • B btsrinath

        Even this did not help me. Is there any initial setup that has to be done on my system even before accessing the database from service applications ? like user creation, giving persmissions etc..etc...? Srinath

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #6

        Nope. It would appear that the database code is not the same as what you've tested in the non-service version.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        B 2 Replies Last reply
        0
        • B btsrinath

          Hi All, I am trying to connect to Oracle database via C# service application. When I try to open the connection i get the exception "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 happens at very first instance(not after some interval...) I have tried to search this on the net, but all in vain. Most of them have given the answere as to check with the connection. Below is the code snippit I am using to connect to database. string csQuery = "prc_ins_sample"; string strConnection = "User ID=xxxx;Password=xxxx;Data Source=xxxxx;"; OracleConnection OraConn = new OracleConnection(); try { OraConn.ConnectionString = strConnection; HMLog.WriteEntry("OraConn.Open();"); OraConn.Open(); OracleCommand OraCmd = new OracleCommand(csQuery, OraConn); OraCmd.CommandType = CommandType.StoredProcedure; HMLog.WriteEntry("OraConn.Open()"); OracleParameter arg_month = new OracleParameter(); arg_month.OracleType = OracleType.Number; arg_month.Direction = ParameterDirection.Input; arg_month.ParameterName = "arg_month"; arg_month.Value = 10; OraCmd.Parameters.Add(arg_month); arg_month = new OracleParameter(); arg_month.ParameterName = "arg_mybal"; arg_month.Direction = ParameterDirection.Output; arg_month.OracleType = OracleType.Number; OraCmd.Parameters.Add(arg_month); HMLog.WriteEntry("Before execution"); int iRecordCount = OraCmd.ExecuteNonQuery(); if ( iRecordCount > 0 ) { } OraConn.Close(); OraConn.Dispose(); } catch(Exception ex) { HMLog.WriteEntry(ex.Message); if (OraConn.State != ConnectionState.Closed ) OraConn.Close(); OraConn.Dispose(); } Does any one know to get out of this problem. Srinath

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #7

          Could it be that (part of) your Oracle is installed "for this user only" instead of "for all users" ? As a test: use another user account on the same machine and try again. :)

          Luc Pattyn

          B 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Nope. It would appear that the database code is not the same as what you've tested in the non-service version.

            Dave Kreskowiak Microsoft MVP - Visual Basic

            B Offline
            B Offline
            btsrinath
            wrote on last edited by
            #8

            Code is very much the same. I am executing that in a console application. While carrying out your previous instruction I was given the permission to execute services(Log on services). So I restarted the machine and then carried out your instruction. Now I have strong feeling that some permission has to be given to my USERID and PWD on the local machine. And the serive was installed using "LocalSystem" property. More over I am logging to a domain. Keeping this in mind I asked you about those question. Let me know if you need more info from my side. Srinath

            1 Reply Last reply
            0
            • L Luc Pattyn

              Could it be that (part of) your Oracle is installed "for this user only" instead of "for all users" ? As a test: use another user account on the same machine and try again. :)

              Luc Pattyn

              B Offline
              B Offline
              btsrinath
              wrote on last edited by
              #9

              Your are right. If I log into machine as a local user i am not able to access the database. Another strange problem, I right click on my console application and then select "Run As" option. Here I am using loginID and PWD, which I have been using so far and working fine. But the application throws an error OCI.DLL The specified module could not be found. Could not create an environment: OCIEnvCreate returned -1. But the same application if double clicked returns the correct answere from the procedure. Srinath

              L 1 Reply Last reply
              0
              • B btsrinath

                Your are right. If I log into machine as a local user i am not able to access the database. Another strange problem, I right click on my console application and then select "Run As" option. Here I am using loginID and PWD, which I have been using so far and working fine. But the application throws an error OCI.DLL The specified module could not be found. Could not create an environment: OCIEnvCreate returned -1. But the same application if double clicked returns the correct answere from the procedure. Srinath

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #10

                Googling oci.dll I found http://www.dll-files.com/dllindex/dll-files.shtml?oci[^] which seems to indicate the file somehow could have been installed on your machine separate from the normal Oracle files, so all is not lost. Search your PC for it, and move or copy it to a more appropriate location (where ever that might be). :)

                Luc Pattyn

                B 1 Reply Last reply
                0
                • L Luc Pattyn

                  Googling oci.dll I found http://www.dll-files.com/dllindex/dll-files.shtml?oci[^] which seems to indicate the file somehow could have been installed on your machine separate from the normal Oracle files, so all is not lost. Search your PC for it, and move or copy it to a more appropriate location (where ever that might be). :)

                  Luc Pattyn

                  B Offline
                  B Offline
                  btsrinath
                  wrote on last edited by
                  #11

                  Actually all those dlls are picked up from my env path variables. So that seems to be ok....:) But the acutal problem still exists. Srinath

                  L 1 Reply Last reply
                  0
                  • B btsrinath

                    Actually all those dlls are picked up from my env path variables. So that seems to be ok....:) But the acutal problem still exists. Srinath

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #12

                    Just checking, is your env path the same for everyone ? And is it set before the service gets started ? -- modified at 18:04 Tuesday 9th January, 2007

                    Luc Pattyn

                    1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      Nope. It would appear that the database code is not the same as what you've tested in the non-service version.

                      Dave Kreskowiak Microsoft MVP - Visual Basic

                      B Offline
                      B Offline
                      btsrinath
                      wrote on last edited by
                      #13

                      Do i have to impersionate the user...while accessing the data base ? Srinath

                      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