Show Table of Contents
18.6. Dead connections
The JDBC protocol does not provide a natural
connectionErrorOccured() event when a connection is broken. To support dead/broken connection checking there are a number of plug-ins.
18.6.1. Valid connection checking
Valid connections can be checked with an SQL statement (as shown below) before handing the connection to the application.
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
If this fails, another connection is selected until there are no more connections at which point new connections are constructed.
A potentially more performant check is to use vendor specific features, for example Oracle or MySQL's
pingDatabase() tool:
<valid-connection-checker-class-name/>

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.