1 Reply Latest reply on May 1, 2002 12:54 AM by David Jencks

    database heartbeats

    attacksub Newbie

      Does anyone know how, or if, JBoss can perform heartbeat operations on connections to a database in the connection pool that are connected to a database, but not currently in use by a user/thread?

      We have the requirement to check the validity of connections at a set interval and are trying to do what BEA can do with their connection heartbeats. Obviously, those that are currently performing SQL operations are OK, its those that aren't performing operations that we need to check.

      Thanks!

        • 1. Re: database heartbeats
          David Jencks Master

          You can't do this right now.

          I don't understand why you would want to. Connections can fail at any time whether they are being used or not. Checking them won't make them less likely to fail.

          What you can do is set the idle timeout so, if you know the database closes unused connnections on you after x minutes, jboss will close unused connections sooner. Set the idletimeout <= x * 2 / 3. (these instructions are for jboss 3)

          If you really need to do this, using jboss 3 you can implement your own managed connection pool and plug it into the connection manager mbean. Your pool can start a thread to go through the pooled connections and check them.