× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



-----Original Message-----
From: Buck Calabro <Buck.Calabro@commsoft.net>
To: midrange-l@midrange.com <midrange-l@midrange.com>
Date: Monday, August 20, 2001 3:02 PM
Subject: RE: triggers within commit cycles


>Hi Bruce!
>
>I've used triggers, and I've used commitment control, but not on the same
>files.  With that in mind,
>
>>When the trigger fires is not the question.
>
>It is if you take the newbie's point of view!  Let's say the application is
>order entry.  There's a trigger on the detail records that accumulates
total
>purchases for a customer, and updates a "credit extended" file.  We start a
>commit cycle and write the detail records one by one as they're entered.
We
>get to the end and the user aborts because they don't want to give out
their
>credit card number.  The detail records are written but not committed,
>there's no header record yet, and we do a ROLLBACK.  Did triggers on the
>detail records ever fire?

Yes, but that's a totally different question. The triggers fire as part of
the IO operation. Different issue.

Determine operation (Ins, Del, Upd), Fire any before, perform IO, fire any
after, return from IO.

Generally, if you are performing business rules with the trigger, and that
trigger involves IO that is used for managing the data of the transaction,
then yes, it really should be part of the original commitment cycle.

If it's writing records for logging, you _probably_ don't want it in the
commit cycle, so you can see the log record even if the user chooses to end
prior to commit.

Architecture.


===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - AS/400 Administrator
 -- IBM Certified Specialist - RPG IV Developer

"America is the land that fought for freedom and then
  began passing laws to get rid of it."

     - Alfred E. Neuman




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.