From: CRPence CRPbottle@xxxxxxxxx
Date: Wed, 11 May 2011 09:40:54 -0500
Subject: Re: Creating a trigger program
On Mon 05-May-2011 19:56 , jmmckee wrote:
We are looking into a process to notify doctors, via email, when one
of their patients has been admitted. When a patient is admitted, a
record is written to a log file. Current idea being tossed around is
to read the log file from the previous day and send emails as needed.
I thought this might be an ideal application for a trigger program.
I could see the trigger getting fired on a write to the log file.
All I would want to do is pass the data to be written to a program
and the program would either send or not send an email. <<SNIP>>
Does business logic dictate that all rows inserted into the log file
should be processed as such [evaluated if, and then to send an e-mail,
based solely on the data in each row], or only dictate that the rows
that this specific application chooses to log should be processed as
such? If the latter, seems to me the trigger may be less appropriate,
especially if the work is just offloaded to be performed asynchronously
[as alluded in other messages is the case] since the trigger would seem
to be adding a level of indirection with little benefit. Obviously
there may be other reasons for which the logic must be or is better
performed outside the existing application; i.e. no capability, or
otherwise undesirable for whatever reason(s), to modify the application
The log file is likely the easiest approach. The log file is written to as
part of processing by an updater program. That is a nasty program to
modify. Do-able, but nasty. Not all records written to the log file would
be used for sending email. Processing would require reading perhaps six
other files. Seemed better to have the trigger program submit a job and not
slow things down. The submitted job would not run long. But, the
processing, if done within the trigger, might not be acceptable. Besides,
if the processing logic was performed inside the trigger itself, should any
change be required in the future, the updater would have to be stopped to
release the lock on the log file. That has been done in the past, but
usually requires advance notice, otherwise a lot of phone calls start
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.