John Thorhauer <[EMAIL PROTECTED]> writes:

> Something has changed in the WorkerThread for jobs so that it is no longer 
> waiting for the job to finish before in runs the following:
> 
> je.setActive(false)
> 
> So my jobs are now overlapping eachother and causing problems.  Can anyone 
> help me with this one?

I recently moved je.setActive(false) from just after the exec() in the
try block into the finally block so that if an exception occurs, the
job will still get set to inactive.

        try
        {
            // Uncomment the log statements for testing.
            // TODO: Use Rafal's new logging API to conditionally log this
            // information at the DEBUG level.
            //noteJobEntryStateChange("started");
            if (! je.isActive())
            {
                je.setActive(true);
                ScheduledJobLoader.getInstance().exec(je, je.getTask());
            }
            //noteJobEntryStateChange("completed");
        }
        catch(Exception e)
        {
            Log.error("Error in WorkerThread for Task: " + je.getTask() +
                      ": "+ e);
        }
        finally
        {
            if (je.isActive())
            {
                je.setActive(false);
            }
        }

-- 

Daniel Rall <[EMAIL PROTECTED]>


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to