3 Replies Latest reply: May 25, 2010 2:09 AM by user60480 RSS

    weblogic Datasource exception, No resources currently available in pool.

    774729
      Hi,

      I am using Oracle driver for connection in datasource in Weblogic 10.3 in my application. I am getting the below exception after I do the search activity number of times ,which uses the connection in this datasource to run a Stored procedure.

      weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool

      I have checked my code thouroughly and there is no connection leak. The connection is closed properly in all possible scneario's. I have verified the same by running the application and then checking the log file immediately.
      The initialcapacity and maxcapacity of the datasource is 1 and 15 respectively. After I get the above exception, if I check the weblogic console, I find in the left bottom corner a window "System status", which has links like "Failed", "Critical", "Overloaded", "Warning" and "Ok". When I clicked on the "Overloaded" link it shown below,

      "JDBC Overloaded Connection Pool Name = null:null:OracleCSIDataSource, State = Overloaded "!

      Thanks & Regards
      Ashwin
        • 1. Re: weblogic Datasource exception, No resources currently available in pool.
          user60480
          this usually happens in 2 scenarios

          1. if the applicaiton using too many concurrent connections and the applicaiton is really busy with DB connecitons, then you have to increase the max capacicty.
          2. The conneciton leak, verify the code and make the connecitons are released properly.

          In most occations, the scenario-2 would be the cause.
          • 2. Re: weblogic Datasource exception, No resources currently available in pool.
            774729
            The first condition is not applicable to my scenario, we do not have much concurrent users. Also even after incresing the max capacity, it occurs but at a later stage.
            Also I have checked the code thoroughly once again, but there is no connection leak.
            Yesterday I found out about datasource property "Inactive connection timeout", after I made this value to 60(seconds) and tested the application continuosly, it didnt fail, it worked. Non zero value of this property means, datasource will reclaim the connection from the application after the set value of seconds.It is a good idea to use this property in production, kindly let me know.

            Regards
            Ashwin
            • 3. Re: weblogic Datasource exception, No resources currently available in pool.
              user60480
              That confirms the conneciton leak situation. We should use the "Inactive Connection Timeout" settings only to reclaim the leaked connections i.e the connections that were not explicitly closed by the application. By Default, this parameter is set to 0 and that means this feature is disabled. This is recommended setting.

              This setting should not be used in place of properly closing connections. Since your applicaiton is not closing the connections explicitly, this settings is coming into picture and it works for you now.

              Ideally, you should set the value as '0' but ofcourse you can use this setting as workaround if its produciton. The permanent fix to review your code again and make sure the connections are properly closed.

              KindRegards
              Ranga Reddy