[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - JBoss does not reconnect after mysql-server restart

wasu do-not-reply at jboss.com
Tue Aug 18 04:51:53 EDT 2009


Hello,

I am using JBoss 4.2.2, mysql-connector-java-5.1.5 and mysql-server 5.1.

I sometimes have to restart my mysql-server (/etc/init.d/mysql restart). However, when I do this, JBoss does not reconnect. I get com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure.

My question: How can I configure JBoss to automatically reconnect when I manually restart my mysql-server?

Here is my mysql-ds.xml configuration:

  | <local-tx-datasource>
  |   <jndi-name>meetings</jndi-name>
  |   <connection-url>jdbc:mysql://localhost:3306/meetings</connection-url>
  |   <driver-class>com.mysql.jdbc.Driver</driver-class>
  |   <user-name>userame</user-name>
  |   <password>password</password>
  |   <valid-connection-checker-classname>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-classname>
  |   <metadata>
  |     <type-mapping>mySQL</type-mapping>
  |   </metadata>
  | </local-tx-datasource>
  | 

I have also tried to use the reconnect property in mysql-ds.xml, however with no success
<connection-property name="autoReconnect">true</connection-property>
Besides, In the documentation I have read not to use this.

Please help. I need the database-connection to be reconnected after the mysql-server restart.
Regards,
Walter


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250094#4250094

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250094



More information about the jboss-user mailing list