|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jolbox.bonecp.hooks.AbstractConnectionHook
public abstract class AbstractConnectionHook
A no-op implementation of the ConnectionHook interface.
| Constructor Summary | |
|---|---|
AbstractConnectionHook()
|
|
| Method Summary | |
|---|---|
void |
onAcquire(ConnectionHandle connection)
Called upon getting a new connection from the JDBC driver (and prior to inserting into the pool). |
boolean |
onAcquireFail(java.lang.Throwable t,
AcquireFailConfig acquireConfig)
Called on attempting (and failing) to acquire a connection. |
void |
onAfterStatementExecute(ConnectionHandle conn,
StatementHandle statement,
java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> params)
Called right after a statement has executed. |
void |
onBeforeStatementExecute(ConnectionHandle conn,
StatementHandle statement,
java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> params)
Called before a statement is about to execute. |
void |
onCheckIn(ConnectionHandle connection)
Called when the connection is about to be returned to the pool. |
void |
onCheckOut(ConnectionHandle connection)
Called when the connection is extracted from the pool and about to be given to the application. |
boolean |
onConnectionException(ConnectionHandle connection,
java.lang.String state,
java.lang.Throwable t)
Called whenever an exception on a connection occurs. |
void |
onDestroy(ConnectionHandle connection)
Called when the connection is about to be completely removed from the pool. |
void |
onQueryExecuteTimeLimitExceeded(ConnectionHandle handle,
java.sql.Statement statement,
java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> logParams)
Called when a query execute time limit has been set and an executing query took longer to than the limit to return control to the application. |
void |
onQueryExecuteTimeLimitExceeded(java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> logParams)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractConnectionHook()
| Method Detail |
|---|
public void onAcquire(ConnectionHandle connection)
ConnectionHook
onAcquire in interface ConnectionHookconnection - Handle to the new connectionpublic void onCheckIn(ConnectionHandle connection)
ConnectionHook
onCheckIn in interface ConnectionHookconnection - being returned to pool.public void onCheckOut(ConnectionHandle connection)
ConnectionHook
onCheckOut in interface ConnectionHookconnection - about to given to the app.public void onDestroy(ConnectionHandle connection)
ConnectionHook
onDestroy in interface ConnectionHook
public boolean onAcquireFail(java.lang.Throwable t,
AcquireFailConfig acquireConfig)
ConnectionHook
onAcquireFail in interface ConnectionHookt - Exception that occurred.acquireConfig - handle containing retry delay, retry attempts etc.
public void onQueryExecuteTimeLimitExceeded(ConnectionHandle handle,
java.sql.Statement statement,
java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> logParams)
ConnectionHook
onQueryExecuteTimeLimitExceeded in interface ConnectionHookhandle - handle to the connectionstatement - statement handle.sql - SQL statement that was used.logParams - Parameters used in this statement.
@Deprecated
public void onQueryExecuteTimeLimitExceeded(java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> logParams)
ConnectionHook
onQueryExecuteTimeLimitExceeded in interface ConnectionHooksql - SQL statement that was used.logParams - Parameters used in this statement.
public boolean onConnectionException(ConnectionHandle connection,
java.lang.String state,
java.lang.Throwable t)
ConnectionHookSQLSTATE Value
Value Meaning
08001 The application requester is unable to establish the connection.
08002 The connection already exists.
08003 The connection does not exist.
08004 The application server rejected establishment of the connection.
08007 Transaction resolution unknown.
08502 The CONNECT statement issued by an application process running with a SYNCPOINT of TWOPHASE has failed, because no transaction manager is available.
08504 An error was encountered while processing the specified path rename configuration file.
SQL Failure codes 08001 & 08007 indicate that the database is broken/died (and thus all remaining connections are killed off).
Anything else will be taken as the connection (not the db) being broken.
Note: You may use pool.isConnectionHandleAlive(connection) to verify if the connection is in a usable state again. Note 2: As in all interceptor hooks, this method may be called concurrently so any implementation must be thread-safe.
onConnectionException in interface ConnectionHookconnection - The handle that triggered this errorstate - the SQLState error code.t - Exception that caused this failure.
public void onBeforeStatementExecute(ConnectionHandle conn,
StatementHandle statement,
java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> params)
ConnectionHook
onBeforeStatementExecute in interface ConnectionHookconn - Connection handlestatement - Handle to the statementsql - SQL statement about to be executed.params - parameters currently bound to the statement
public void onAfterStatementExecute(ConnectionHandle conn,
StatementHandle statement,
java.lang.String sql,
java.util.Map<java.lang.Object,java.lang.Object> params)
ConnectionHook
onAfterStatementExecute in interface ConnectionHookconn - Connection handlestatement - Handle to the statementsql - SQL statement about to be executed.params - parameters currently bound to the statement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||