public final class FatalErrorHelper
extends java.lang.Object
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.
Modifier and Type | Method and Description |
---|---|
static boolean |
isBrokenConnection(java.lang.Exception exception)
Checks whether
exception indicates a broken connection. |
static boolean |
isFatal(java.sql.SQLException exception)
Check whether the specified exception is fatal from the XCA point of view.
|
public static boolean isFatal(java.sql.SQLException exception)
exception
- exception to check.true
if the exception that happened is fatalpublic static boolean isBrokenConnection(java.lang.Exception exception)
exception
indicates a broken connection. There is overlap with
isFatal(SQLException)
, but neither is a subset of the other.
Specifically, this method will check if the first SQLException
in the cause-chain of exception
(including exception
itself) has a "broken connection error code" (a proper subset of "fatal error
codes"), or otherwise of there is a SocketTimeoutException
or SocketException
in 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.
exception
- exception to checktrue
if the error code is signals a (possibly) broken connectionCopyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.