public static final class DefaultHook.GetConnectionTiming extends DefaultHook implements Hook.GetConnection
DefaultHook.CloseConnection, DefaultHook.GetConnectionTimeout, DefaultHook.GetConnectionTiming, DefaultHook.InitConnection, DefaultHook.QueryTiming, DefaultHook.ResultSetSizeHook.CloseConnection, Hook.DestroyConnection, Hook.GetConnection, Hook.GetConnectionTimeout, Hook.InitConnection, Hook.MethodInvocation, Hook.ResultSetRetrieval, Hook.StatementExecution, Hook.StatementProceedingPoint| Constructor and Description |
|---|
GetConnectionTiming(ViburConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
on(Connection rawConnection,
long takenNanos)
A programming hook that will be invoked on the raw JDBC Connection after it is taken from the pool
as part of the
DataSource.getConnection() flow. |
public GetConnectionTiming(ViburConfig config)
public void on(Connection rawConnection, long takenNanos)
Hook.GetConnectionDataSource.getConnection() flow.
Its execution should take as short time as possible.
Worth noting that since version 19.0 the takenNanos parameter represents only the
time waited for an object to become available in the pool, excluding any object creation time.
This hook complements the CloseConnection hook, which is invoked
before the raw JDBC Connection is restored back to the pool.
on in interface Hook.GetConnectionrawConnection - the retrieved from the pool raw JDBC Connection; note that it can be
null if we were unable to obtain a connection from the pool within the
specified time limit, if the current thread was interrupted, or if we attempted to
create a new connection in the pool and the attempt failed with an exceptiontakenNanos - the time taken to get this connection in nanosecondsCopyright © 2013-2019 vibur.org. All Rights Reserved.