public static interface Hook.GetConnection 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 on the raw JDBC Connection after it is taken from the pool
as part of the
DataSource.getConnection() flow. |
void on(Connection rawConnection, long takenNanos) throws SQLException
DataSource.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.
rawConnection - 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 nanosecondsSQLException - to indicate that an SQL error has occurredCopyright © 2013-2019 vibur.org. All Rights Reserved.