Class FatalErrorHelper
- java.lang.Object
-
- org.firebirdsql.jaybird.xca.FatalErrorHelper
-
public final class FatalErrorHelper extends java.lang.ObjectHelper class for the exception handling in XCA framework. The JCA specification required a resource adapter to report an error if it is certain that no other operations can be executed over that particular managed connection.In case of Firebird, few errors belong to the so-called "fatal errors", after which client application cannot continue its job. For example, when a socket connection to the server is broken, any subsequent operation will fail. The XCA container should remove the connection from the pool in order to allow process to recover (when Firebird server is restarted).
NOTE: Although these methods are intended for use within XCA, they can be used for other parts of Jaybird which have similar needs for connection error evaluation.
- Author:
- Roman Rokytskyy, Mark Rotteveel
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisBrokenConnection(java.lang.Exception exception)Checks whetherexceptionindicates a broken connection.static booleanisFatal(java.sql.SQLException exception)Check whether the specified exception is fatal from the XCA point of view.
-
-
-
Method Detail
-
isFatal
public static boolean isFatal(java.sql.SQLException exception)
Check whether the specified exception is fatal from the XCA point of view.- Parameters:
exception- exception to check.- Returns:
trueif the exception that happened is fatal
-
isBrokenConnection
public static boolean isBrokenConnection(java.lang.Exception exception)
Checks whetherexceptionindicates a broken connection. There is overlap withisFatal(SQLException), but neither is a subset of the other.Specifically, this method will check if the first
SQLExceptionin the cause-chain ofexception(includingexceptionitself) has a "broken connection error code" (a proper subset of "fatal error codes"), or otherwise of there is aSocketTimeoutExceptionorSocketExceptionin the cause-chain.NOTE: Exact checks done by this method may be revised in any point release, and above documentation should be considered illustrative, and not prescriptive.
- Parameters:
exception- exception to check- Returns:
trueif the error code is signals a (possibly) broken connection
-
-