2 Replies Latest reply on Mar 23, 2007 3:52 PM by Sebastián Lacuesta

    Datasource failover, sudden disconnection not working

    Sebastián Lacuesta Newbie

      I have a problem using datasource failover with MySQL. My setup is JBoss at host A, and mysql in host B, replicated in host A. I have followed the instructions in JBossJCADatabaseFailover.
      When I stop mysql at machine B with /etc/init.d/mysql stopfailover works flawlessly, but if I disconnect B's network cable, the application just keeps waiting for the query, and no failover is done. The datasource configuration is:

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- $Id: mysql-ds.xml,v 2006/02/07 14:23:00 acoliver Exp $ -->
      <!-- Datasource config for MySQL using 3.0.9 available from:http://www.mysql.com/downloads/api-jdbc-stable.html-->

      <!-- should only be used on drivers after 3.22.1 with "ping" support -->

      <!-- sql to call when connection is created
      <new-connection-sql>select sysdate() from dual</new-connection-sql>
      <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers -->
      <check-valid-connection-sql>select sysdate() from dual</check-valid-connection-sql>

      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->



      The hosts are:


      I could keep playing with blocking-timeout-millis, but I prefer to ask before continue. My question is: What should I have to consider in order to solve this? I mean, get failover working when a database stop working suddenly, not by stopping it cleanly.