Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

MySQL has some "Server System Variables".
One of these is wait_timeout, which has the value 28800 seconds as default.
Look at http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout for more information about wait_timeout.

wait_timeout is the number of seconds the server waits for activity on a non interactive connection before closing it.
Unfortunately, the server doesn't tell the client whether the connection is closed so that the client will use a closed connection which throws an error

Code Block

 Lock wait timeout exceeded; try restarting transaction

or

Code Block

 The last packet successfully received from the server was xxx,xxx,xxx milliseconds ago.  
 The last packet sent successfully to the server was xxx,xxx,xxx milliseconds ago. is longer than the server configured value of 'wait_timeout'.

...

A workaround in the JobScheduler is to configure a job with a repeat interval in its schedule which is shorter than the wait_timeout value.
For example you can use the scheduler_dequeue_mail job in ./config/live/sos/housekeeping/scheduler_dequeue_mail.job.xml.

Code Block

 <?xml version="1.0" encoding="iso-8859-1"?>
 
 <job title = "Send buffered mails from mail queue">
 
    <description>
       <include file = "jobs/JobSchedulerDequeueMailJob.xml"/>
    </description>
     
    <script language      = "java"
            java_class    = "sos.scheduler.job.JobSchedulerDequeueMailJob"/>
    
    &lt;<!-- repeat dequeueing in the given interval of seconds (1 hour) --&gt;>
    <run_time let_run = "yes"
              repeat  = "3600"/>
     
 </job>