com.uwyn.rife.database
Class DbProbeExecutor

java.lang.Object
  extended by com.uwyn.rife.scheduler.Executor
      extended by com.uwyn.rife.database.DbProbeExecutor

public class DbProbeExecutor
extends Executor

Periodic probe job to keep connections non-idle and probe for dead ones. This is primarily useful for MySQL, which closes connections after a period of inactivity.

This should be run using a scheduler participant. For example, to probe the "mysql" Datasource once a minute:

 <scheduler>
   <task classname="com.uwyn.rife.database.DbProbeExecutor" 
         frequency="* * * * *">
     <option name="datasource">mysql</option>
     <option name="query">select 1</option>
   </task>
 </scheduler>

There are two optional parameters.

datasource
The name of the Datasource to probe. If not specified, the default is "datasource".
query
The dummy query to send. If not specified, the default is "select 1".

Since:
1.6
Version:
$Revision: $
Author:
Steven Grimm (koreth[remove] at midwinter dot com)

Constructor Summary
DbProbeExecutor()
           
 
Method Summary
 boolean executeTask(Task task)
           
 String getHandledTasktype()
           
 
Methods inherited from class com.uwyn.rife.scheduler.Executor
getRescheduleDelay, getScheduler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbProbeExecutor

public DbProbeExecutor()
Method Detail

executeTask

public boolean executeTask(Task task)
Specified by:
executeTask in class Executor

getHandledTasktype

public String getHandledTasktype()
Specified by:
getHandledTasktype in class Executor


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.