3 Replies Latest reply: Feb 25, 2009 7:20 AM by Daniel Celentano RSS

Datasource Recovery

Sambit Dikshit Newbie

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 Newbie

    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
    Sambit Dikshit Newbie

    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 Newbie

    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