Logo Search packages:      
Sourcecode: mysql-connector-java version File versions  Download package

NdbLoadBalanceExceptionChecker.java

package com.mysql.jdbc;

import java.sql.SQLException;

00005 public class NdbLoadBalanceExceptionChecker extends
            StandardLoadBalanceExceptionChecker {

00008       public boolean shouldExceptionTriggerFailover(SQLException ex) {
            return super.shouldExceptionTriggerFailover(ex) || checkNdbException(ex);
      }
      
      private boolean checkNdbException(SQLException ex){
            // Have to parse the message since most NDB errors are mapped to the same DEMC, sadly.
            return (ex.getMessage().startsWith("Lock wait timeout exceeded") || 
                        (ex.getMessage().startsWith("Got temporary error") 
                        && ex.getMessage().endsWith("from NDB")));
      }
}

Generated by  Doxygen 1.6.0   Back to index