Can't get datasource failover working with JBoss
Posted by: Terry Ray
Date: October 27, 2004 08:03AM


I am trying to set my datasource up so that if my primary mysql server goes down, the datasource will use the backup server. I am using:

jboss-3.2.5 (default config)
red hat ews 3.0

Here is the snippet from my datasource config file (mysql-ds.xml):


I have tried using different connection-url parameter values (with and without the port numbers, etc) and some of the available options such as autoReconnect=true on the url. I have even tried the latest "development" version of the mysql connector which is supposed to have an autoReconnect for connection pools. But, still no luck.

For my test, I start with the two database servers running. I start using my jboss app, then shutdown the localhost instance of mysql. When jboss goes for another connection, I get the following exception:

Communication link failure:, underlying cause: null

It looks to me that the jboss connection pool is holding these closed connections. As a test, I pulled up the ManagedConnectionPool for my datasource using the jboss jmx-console and invoked the flush() method. After doing this, jboss rebuilt the connection pool with connections from the other (back-up) server and everything was cool.

Am I missing something on the failover settings at the datasource level? I realize this is as much as jboss question as a mysql question but I've had no luck so far on the jboss forum. Maybe someone out there has a similar config and can lend some advice.

Any help is appreciated. Much thanks.


Options: ReplyQuote

Written By
Can't get datasource failover working with JBoss
October 27, 2004 08:03AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.