Class ResetAbandonedTimer

All Implemented Interfaces:
InvocationHandler, ResetAbandonedTimerMBean

public class ResetAbandonedTimer extends AbstractQueryReport implements ResetAbandonedTimerMBean
Class that resets the abandoned timer on any activity on the Connection, on any query execution and on any read of a ResultSet returned by a statement obtained from the pooled connection, whether the operation completed successfully or failed. Iterating a large result set therefore keeps the connection alive through the fetch phase, not only until the query returns. Each reset happens when an individual call completes, so a single call that itself blocks on the database for longer than PoolConfiguration.setRemoveAbandonedTimeout(int) still gets the connection abandoned. The statement facade is always used, so a result set handle that outlives its borrow is sealed off before it can go on refreshing the abandoned timer of whoever holds that physical connection next. The handles this interceptor hands out release what they wrap - the statement layer, the physical result set - once a close has been forwarded to it, and answer any later call from the closed contract, as the statement facade's own handles do; a handle the application keeps beyond its close therefore stops keeping the physical objects below it reachable. 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.