Jigsaw Blog

25

Jun
2013
0 comments

The whole Job Queue stops when a lock time out occurs

Running NAS with Job Queue will start a timer to process Job Queue Entries every two seconds.

In the original code the Timer is disabled before checking the Job Queue Entries and then enabled again after the process.

If NAS will not be able to read the Job Queue Entry then the function will exit without enabling the Timer and nothing will be processed.

The original code in Codeunit 448 is

HandleRequest()

 

JobQueueSetup.GET;

 

IF NOT JobQueueSetup."Job Queue Active" THEN

 

EXIT;

 

NavTimer.Enabled := FALSE;

 

ThisSessionIsActive := UpdateJobQueueSession(JobQueueEntry,FALSE);

 

...

 

CleanUpJobQueue;

 

COMMIT;

 

NavTimer.Enabled := TRUE;

 

 

Its suggested you find a suitable period of time where everything in the Queue should have processed and change the behaviour. Do not disable the timer, just change the interval. Here the interval is changed to five minutes.

The replacement code would then be

HandleRequest()

 

JobQueueSetup.GET;

 

IF NOT JobQueueSetup."Job Queue Active" THEN

 

EXIT;

 

NavTimer.Enabled := FALSE;

 

NavTimer.Interval := 5 * 60 * 1000; // 5 min

 

NavTimer.Enabled := TRUE;

 

ThisSessionIsActive := UpdateJobQueueSession(JobQueueEntry,FALSE);

 

...

 

CleanUpJobQueue;

 

COMMIT;

 

NavTimer.Enabled := FALSE;

 

NavTimer.Interval := 2 * 1000; // 2 sec.

 

NavTimer.Enabled := TRUE;

This has been reproduced from a post at http://www.dynamics.is/?p=723

Its is not our idea but I have captured for our use in case the link disappears.