Package com.mysql.cj.jdbc.ha
Class NdbLoadBalanceExceptionChecker
java.lang.Object
com.mysql.cj.jdbc.ha.StandardLoadBalanceExceptionChecker
com.mysql.cj.jdbc.ha.NdbLoadBalanceExceptionChecker
- All Implemented Interfaces:
LoadBalanceExceptionChecker
public class NdbLoadBalanceExceptionChecker extends StandardLoadBalanceExceptionChecker
-
Constructor Summary
Constructors Constructor Description NdbLoadBalanceExceptionChecker()
-
Method Summary
Modifier and Type Method Description boolean
shouldExceptionTriggerFailover(java.lang.Throwable ex)
Invoked to determine whether or a given SQLException should trigger a failover in a load-balanced deployment.
-
Constructor Details
-
NdbLoadBalanceExceptionChecker
public NdbLoadBalanceExceptionChecker()
-
-
Method Details
-
shouldExceptionTriggerFailover
public boolean shouldExceptionTriggerFailover(java.lang.Throwable ex)Description copied from interface:LoadBalanceExceptionChecker
Invoked to determine whether or a given SQLException should trigger a failover in a load-balanced deployment. The driver will not pass in a Connection instance when calling init(), but it will pass in the Properties, otherwise it acts like a normal Extension. One instance of a handler *per* JDBC connection instance will be created. If you need singleton-like behavior, you're on your own to provide it.- Specified by:
shouldExceptionTriggerFailover
in interfaceLoadBalanceExceptionChecker
- Overrides:
shouldExceptionTriggerFailover
in classStandardLoadBalanceExceptionChecker
- Parameters:
ex
- exception- Returns:
- true if the exception should trigger failover.
-