3 Replies Latest reply on Feb 25, 2009 7:20 AM by daniel.celentano

    Datasource Recovery

      Hi,
      I would like to know if Jboss provides this mechanism. Here is the scenario.

      1. Set up a Datasource in -ds.xml file. Non XA datasource.
      2. Start Jboss Application Server.
      3. For some reason Database is down.
      4. When try to get a connection from Datasource, it throws exception which is fine.
      5. After certain time - 10 15 mins, lets say Database is up again.
      6. When you try to get a connection from datasource, does it return a valid connection or we need to restart the Datasource through MBean.

      Does the point # 6 is handled by Jboss Mbean automatically or we need to take care of this.

      Regards
      -Sambit

        • 1. Re: Datasource Recovery
          daniel.celentano

          Hi Sambit,

          When DB is running again then just make a touch to datasource file. This will redeploy all mbean related with datasource and restart conection pool.

          After this touch your system will work fine again.

          Daniel

          • 2. Re: Datasource Recovery

            Hi Daniel,
            Thanks. The problem is access to production environment. I'm thinking of automating these steps. May be i have to write a connection-checker class and add the entry to -ds.xml file. This connection-checker class will check for connection and redeploy the mbean. Other approach would be to handle it programatically in the code where you get a connection from Datasource, we can redeploy the datasource again using the Mbean.

            Regards
            -Sambit

            • 3. Re: Datasource Recovery
              daniel.celentano

              Sambit,

              Rigth now you can do a re-deploy of you datasource from jmx-console.
              And could be interesting for you this open source product:

              http://www.jboss.org/jopr/

              take a look!

              Regards,
              Daniel