1 Reply Latest reply on Nov 28, 2006 1:44 PM by john willemin

    Programatically restarting datasource under certain conditio

    john willemin Newbie

      So, we ran into a situation (somehow) where all of a sudden the connection pool stops giving us good connections. We try to do stuff, but all we get is "connection closed" errors. All we know, right now, is that restarting fixes it.

      We haven't been able to reproduce this yet, but I'd like to plumb something in to do the restart automatically. We have a datasource in an XML file, and a .war that uses the datasource (but strictly speaking, does not depend on the datasource, i.e. we have not linked them to be dependent).

      I am trying to figure out what the best way to do this is:
      -Grab just our datasource from an MBeanServerConnection and somehow restart it, or
      -Grab the CachedConnectionManager from an MBeanServerConnection and restart it?

      I can't remember exactly whether one does those things directly (by getting a reference to the CCM and then invoking CCM.stop() and CCM.start()) or if you have to go through the JMX bus somehow. Since stop and start are protected I am assuming that there is a different way I need to do this.

      Thanks!

      John