2 Replies Latest reply on Mar 11, 2004 10:30 AM by mike andrews

    trying to understand JBossManagedConnectionPool idle timeout

    mike andrews Newbie

      hi folks,

      i'm suspecting that idle timeouts on sql Connection objects may not be timing out as i expect them to, and i'm trying to trace the behaviour to code in IdleRemover and InternalManagedConnectionPool.

      what i think i saw in my application was that even though some connections were idle for many many hours, they were not being reclaimed by the server --- even though i left the default timeout to 15 minutes.

      looking in the source code this morning (jboss-3.2 Branch_3_2 head), i see that InternalManagedConnectionPool.removeTimedOut() just looks at the oldest connection and checks if it timed out. if its not timed out, it does nothing more.

      what i'm thinking of is the situation where the first connection is continuously used, and more recently made connections time out. thus, based on my understanding of the source code logic (which may be flawed since i just started looking at it!), those later connections would never get removed due to time out. is that so? and if it is, is it the desired behaviour? i'm guessing this may be the cause of the connection resource leak i saw (aside from my bad programming practice where i forgot to execute Connection.close() in some cases!)

      thanks,
      mike