public static interface Hook.InitConnection extends Hook
Hook.CloseConnection, Hook.DestroyConnection, Hook.GetConnection, Hook.GetConnectionTimeout, Hook.InitConnection, Hook.MethodInvocation, Hook.ResultSetRetrieval, Hook.StatementExecution, Hook.StatementProceedingPoint| Modifier and Type | Method and Description |
|---|---|
void |
on(Connection rawConnection,
long takenNanos)
A programming hook that will be invoked only once after the raw JDBC Connection is first created.
|
void on(Connection rawConnection, long takenNanos) throws SQLException
The takenNanos parameter includes as a minimum the time taken to establish (or attempt to
establish) one physical connection to the database, plus possibly the time taken to make up to
ViburConfig.acquireRetryAttempts that are separated by a ViburConfig.acquireRetryDelayInMs,
if there were errors while trying to establish the connection.
Worth noting that since version 19.0 the rawConnection parameter can be null, which
means that the attempt to establish a connection, plus all reattempts, were unsuccessful.
This hook complements the DestroyConnection hook, which is invoked
after the raw JDBC Connection is destroyed.
rawConnection - the just created raw JDBC Connection; note that it can be
null if we were unable to establish a connection to the databasetakenNanos - the time taken to establish (or attempt to establish) the connection in nanosecondsSQLException - to indicate that an SQL error has occurredCopyright © 2013-2019 vibur.org. All Rights Reserved.