|
A discussion of Triggers the other day got a little heated when one member of the discussion said that IBM recommends that Trigger programs should not be designed to SBMJOB jobs but rather should do all of the processing within the bounds of the trigger program itself.
A trigger is fired every time the "event" occurs. Let's say that every time a record is added to a file, you want to submit a job to do some processing. This means:
a) Every time an application writes a record, a new job will be created.b) If a program writes 10 records in rapid succession, 10 jobs will be submitted. You'd better be careful to make sure those jobs can run concurrently and not conflict with one another.
c) If you copy a file with 10000 records onto the file with the trigger, you'll submit 10000 jobs, which might cause a big slowdown on the system as all 10000 are launched at once.
Even worse is when the event is on an update or delete, because you may have batch processes updating or deleting thousands and thousands of records, causing thousands and thousands of jobs to be submitted.
But, having said that... not everyone does that. Sometimes people have files that aren't added to, updated or deleted rapidly. Maybe in your business you have a file where one record is added one time per day. In that situation, having a job submitted isn't a problem at all.
And that's the point I really want to make... it all depends on your business and how it works. YOU have to decide what's acceptable and what's not.
I personally think that data queues (or a similar means) are a much better idea than submitting a new job for every record, since they allow you to control how many jobs get submitted at any one point, and therefore keep things running smoothly.
Doing things within the bounds of the trigger might be good, too... it really depends on what you have to do!
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.