public class ResetAbandonedTimer extends AbstractQueryReport
PoolConfiguration.setRemoveAbandonedTimeout(int)
that is fairly low, and you want to reset the abandoned time each time any operation on the connection is performed
This is useful for batch processing programs that use connections for extensive amount of times.AbstractQueryReport.StatementProxy
constructors, threshold
CREATE_STATEMENT, CREATE_STATEMENT_IDX, EXECUTE, EXECUTE_BATCH, EXECUTE_QUERY, EXECUTE_TYPES, EXECUTE_UPDATE, PREPARE_CALL, PREPARE_CALL_IDX, PREPARE_STATEMENT, PREPARE_STATEMENT_IDX, STATEMENT_TYPE_COUNT, STATEMENT_TYPES
CLOSE_VAL, EQUALS_VAL, GETCONNECTION_VAL, HASHCODE_VAL, ISCLOSED_VAL, ISVALID_VAL, ISWRAPPERFOR_VAL, properties, TOSTRING_VAL, UNWRAP_VAL
Constructor and Description |
---|
ResetAbandonedTimer() |
Modifier and Type | Method and Description |
---|---|
void |
closeInvoked()
Method invoked when the operation
Connection.close() is invoked. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Gets invoked each time an operation on
Connection is invoked. |
protected void |
prepareCall(String query,
long time)
Invoked when prepareCall has been called and completed.
|
protected void |
prepareStatement(String sql,
long time)
Invoked when prepareStatement has been called and completed.
|
protected String |
reportQuery(String query,
Object[] args,
String name,
long start,
long delta)
Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was within the timing threshold
|
protected String |
reportSlowQuery(String query,
Object[] args,
String name,
long start,
long delta)
Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold
|
boolean |
resetTimer() |
createStatement, getConstructor, getThreshold, reportFailedQuery, setThreshold
isExecute, isStatement, process, reset
compare, compare, disconnected, getNext, getProperties, isUseEquals, poolClosed, poolStarted, setNext, setProperties, setUseEquals
public boolean resetTimer()
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
AbstractCreateStatementInterceptor
Connection
is invoked.
invoke
in interface InvocationHandler
invoke
in class AbstractCreateStatementInterceptor
Throwable
protected void prepareCall(String query, long time)
AbstractQueryReport
prepareCall
in class AbstractQueryReport
query
- - the string used to prepare the statement withtime
- - the time it took to invoke prepareprotected void prepareStatement(String sql, long time)
AbstractQueryReport
prepareStatement
in class AbstractQueryReport
sql
- - the string used to prepare the statement withtime
- - the time it took to invoke preparepublic void closeInvoked()
AbstractCreateStatementInterceptor
Connection.close()
is invoked.closeInvoked
in class AbstractCreateStatementInterceptor
protected String reportQuery(String query, Object[] args, String name, long start, long delta)
AbstractQueryReport
reportQuery
in class AbstractQueryReport
query
- the query that was executed and failedargs
- the arguments to the executionname
- the name of the method used to execute AbstractCreateStatementInterceptor.isExecute(Method, boolean)
start
- the time the query execution starteddelta
- the time the execution tookprotected String reportSlowQuery(String query, Object[] args, String name, long start, long delta)
AbstractQueryReport
reportSlowQuery
in class AbstractQueryReport
query
- the query that was executed and failedargs
- the arguments to the executionname
- the name of the method used to execute AbstractCreateStatementInterceptor.isExecute(Method, boolean)
start
- the time the query execution starteddelta
- the time the execution tookCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.