Class ResetAbandonedTimer

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler, ResetAbandonedTimerMBean

    public class ResetAbandonedTimer
    extends AbstractQueryReport
    implements ResetAbandonedTimerMBean
    Class that resets the abandoned timer on any activity on the Connection or any successful query executions. This interceptor is useful for when you have a 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.
    • Constructor Detail

      • ResetAbandonedTimer

        public ResetAbandonedTimer()
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Description copied from class: AbstractCreateStatementInterceptor
        Gets invoked each time an operation on Connection is invoked.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Overrides:
        invoke in class AbstractCreateStatementInterceptor
        Throws:
        java.lang.Throwable
      • prepareCall

        protected void prepareCall​(java.lang.String query,
                                   long time)
        Description copied from class: AbstractQueryReport
        Invoked when prepareCall has been called and completed.
        Specified by:
        prepareCall in class AbstractQueryReport
        Parameters:
        query - - the string used to prepare the statement with
        time - - the time it took to invoke prepare
      • prepareStatement

        protected void prepareStatement​(java.lang.String sql,
                                        long time)
        Description copied from class: AbstractQueryReport
        Invoked when prepareStatement has been called and completed.
        Specified by:
        prepareStatement in class AbstractQueryReport
        Parameters:
        sql - - the string used to prepare the statement with
        time - - the time it took to invoke prepare
      • reportQuery

        protected java.lang.String reportQuery​(java.lang.String query,
                                               java.lang.Object[] args,
                                               java.lang.String name,
                                               long start,
                                               long delta)
        Description copied from class: AbstractQueryReport
        Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was within the timing threshold
        Overrides:
        reportQuery in class AbstractQueryReport
        Parameters:
        query - the query that was executed and failed
        args - the arguments to the execution
        name - the name of the method used to execute AbstractCreateStatementInterceptor.isExecute(Method, boolean)
        start - the time the query execution started
        delta - the time the execution took
        Returns:
        - the SQL that was executed or the string "batch" if it was a batch execution
      • reportSlowQuery

        protected java.lang.String reportSlowQuery​(java.lang.String query,
                                                   java.lang.Object[] args,
                                                   java.lang.String name,
                                                   long start,
                                                   long delta)
        Description copied from class: AbstractQueryReport
        Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold
        Overrides:
        reportSlowQuery in class AbstractQueryReport
        Parameters:
        query - the query that was executed and failed
        args - the arguments to the execution
        name - the name of the method used to execute AbstractCreateStatementInterceptor.isExecute(Method, boolean)
        start - the time the query execution started
        delta - the time the execution took
        Returns:
        - the SQL that was executed or the string "batch" if it was a batch execution