Skip to Content
0

Multiple jobs for same program are not overlapping or affecting each other?

Jul 04, 2017 at 01:50 PM

96

avatar image

We have a custom program in ECC that sends email notifications for different invoice statuses and updates the statuses in a custom table for each invoice, inside the program. This custom program needs to be scheduled multiple times such that the multiple job runs might overlap with each other.


How can we ensure that the multiple job runs for the same program are not overlapping with each other and stopping the processing of any of the multiple job runs?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Michał Majer Jul 04, 2017 at 01:54 PM
3

You should use Enqueue / Dequeue, to be sure that only one program access to selected data. With enqueue, data is blocked in the current process. If another program will try to access same data we can wait when other program ends processing or wait in the queue.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thank you for your answer.
If we are using a lock object for the custom table that is updated by the job, we can use enqueue/dequeue only during custom table updation right?
Also we need to specify in the program code how much time is needed to wait if it finds the table locked?

0

If a job B is started while a job A is still running, I think the job B should stop immediately, as the job A should control whether there is still some data to process before ending (and process it if any).

You can enqueue/dequeue as you wish, when you wish. It's not related to the database update. It's only related to the "update task" if you use one (CALL FUNCTION IN UPDATE TASK). You can use a lock object even on a DDIC structure.

0

For this type of thing I tend to enqueue the TRDIR entry for the actual program and check that during initialisation.

0
Mike Pokraka Jul 05, 2017 at 06:46 AM
1

Another technique is to have each job reschedule itself. You would have to build your monthly/weekly variants into your rescheduling code.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Or use a table....

0