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
Modifier and TypeMethodDescriptionstatic booleanisBrokenConnection(Exception exception) Checks whetherexceptionindicates a broken connection.static booleanisFatal(SQLException exception) Check whether the specified exception is fatal from the XCA point of view.
-
Method Details
-
isFatal
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
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
-