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
threshold
constructors, 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. |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Gets invoked each time an operation on
Connection is invoked. |
protected void |
prepareCall(java.lang.String query,
long time)
Invoked when prepareCall has been called and completed.
|
protected void |
prepareStatement(java.lang.String sql,
long time)
Invoked when prepareStatement has been called and completed.
|
protected java.lang.String |
reportQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.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 java.lang.String |
reportSlowQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.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, getThreshold, reportFailedQuery, setThreshold
getConstructor, isExecute, isStatement, process, reset
compare, compare, disconnected, getNext, getProperties, isUseEquals, poolClosed, poolStarted, setNext, setProperties, setUseEquals
public boolean resetTimer()
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
AbstractCreateStatementInterceptor
Connection
is invoked.
invoke
in interface java.lang.reflect.InvocationHandler
invoke
in class AbstractCreateStatementInterceptor
java.lang.Throwable
protected void prepareCall(java.lang.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(java.lang.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 java.lang.String reportQuery(java.lang.String query, java.lang.Object[] args, java.lang.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 java.lang.String reportSlowQuery(java.lang.String query, java.lang.Object[] args, java.lang.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-2018 Apache Software Foundation. All Rights Reserved.