4 Replies Latest reply on Jun 13, 2008 2:12 PM by vickyk

    Idle timeout minutes not working? Database connection doesn'

    alchemista

      I've set the property:

      <idle-timeout-minutes>1</idle-timeout-minutes>

      on my Oracle datasource.

      To test that this is working, I put a delay in my code like:
      {
      open connection
      // do delay here for 10 minutes
      prepare statement
      execute
      close connection
      }

      My code does delay in the spot for 10 minutes. However, I get no exception when calling prepareStatement or execute later. I would expect that if the connection is closed by the pool, I should get an error after the delay completes.

      Any ideas what is going wrong?

        • 1. Re: Idle timeout minutes not working? Database connection do
          mkaul

          Hi,
          I have a similar problem while setting up oracle-ds.xml with the following settings.

          <min-pool-size>10</min-pool-size>
          <max-pool-size>50</max-pool-size>
          <idle-timeout-minutes>10</idle-timeout-minutes>

          I keep monitoring the Oracle sessions and find that the Idle sessions in the database stay INACTIVE for way over 10 minutes. Is there a check in JBoss that says "Only start checking if sessions are idle once they are above the MIN POOL size"? I don't understand how this works. Can someone please shed some light as to how I can troubleshoot this problem or better give me the solution to this problem?
          Initially I found that the problem was that the tags for idle timeout were misformed and set to something ridiculously high like 500 minutes! But looking at the JMX MBean console proved that this parameter was set to 15 minutes! The database at the back showed idle sessions sitting for hours!
          Any help would be appreciated.

          Cheers,
          MK

          • 2. Re: Idle timeout minutes not working? Database connection do
            vickyk

             

            "alchemista" wrote:
            I would expect that if the connection is closed by the pool, I should get an error after the delay completes.

            Any ideas what is going wrong?


            The connections which are not inuse for idletimeout periods will be removed , the connections in your case is being held by the application code .

            Search the jboss wiki / google to get more details about idletimeout feature .



            • 3. Re: Idle timeout minutes not working? Database connection do
              peterj

               

              mkaul wrote:
              Is there a check in JBoss that says "Only start checking if sessions are idle once they are above the MIN POOL size"?


              Yes, that is the way it works. You will never have less that min connections, even if they are all idle.

              Also, there was a forum post earlier this year where someone noticed that at the timeout period, all idle connections were dropped, and then min connections re-established. Thus on a completely idle system the connections were recycled every timeout minutes.

              Also, you should have started a new post, not appended to a 3 year old post.

              • 4. Re: Idle timeout minutes not working? Database connection do
                vickyk

                 

                "PeterJ" wrote:
                .
                Also, you should have started a new post, not appended to a 3 year old post.


                Ah I replied the 3 year old post ;(
                I ignore the hijacked threads , I did the same for this but did not checked the date of the initial post .....