HikariCP
HikariCP copied to clipboard
Why use conn twice?
void quietlyCloseConnection(final Connection connection, final String closureReason)
{
if (connection != null) {
try {
logger.debug("{} - Closing connection {}: {}", poolName, connection, closureReason);
// continue with the close even if setNetworkTimeout() throws
try (connection; connection) {
if (!connection.isClosed())
setNetworkTimeout(connection, SECONDS.toMillis(15));
} catch (SQLException e) {
// ignore
}
}
catch (Exception e) {
logger.debug("{} - Closing connection {} failed", poolName, connection, e);
}
}
}
try (connection; connection)
Why use conn twice?