The only concern is the activation group(s) of the trigger and service program.
The trigger should have an activation group of *CALLER, if the transaction that fires the trigger is under commitment control any database operations done by the trigger will also be under the same commitment transaction. If the service program procedures do any database operations (insert, update, delete) then it should also probably have an activation group of *CALLER.
Having an activation group of *CALLER could cause you problems though, because if multiple programs with different named activation groups use the table with this trigger the trigger could exist in multiple activation groups with completely separate variable storage.
I hope this makes sense.
Duane
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Charles Wilt
Sent: Thursday, September 04, 2008 8:59 AM
To: Midrange Systems Technical Discussion
Subject: Triggers and service programs
All,
Just wanted to confirm that if I have a ILE program as a trigger, that
calls procedures in a service program, there is nothing special I need
be concerned with due to the fact the DB manager invoked the trigger.
Specifically, I'm wondering about the behavior of module level global variables.
Here's what I'm thinking about.
PGMA calls TRGMOD_Proc1 which sets a module level variable trigFlag in
the TRGMOD module that is part of TRGSRVPGM.
TRGMOD_Proc1 updates a file which has TRGPGM attached as an update trigger.
TRGPGM calls TRGMOD_UpdTrgProc which references the module level
variable trigFlag in the TRGMOD module
I don't see any reason why this wouldn't work, but I wanted to run it
by the experts here.
Thanks in advance!
Charles Wilt
--
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,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/midrange-l.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________
NOTICE: This electronic mail transmission may contain confidential information and is intended only for the person(s) named. Any use, copying, or disclosure by any other person is strictly prohibited. If you have received this transmission in error, please notify the sender via e-mail.
As an Amazon Associate we earn from qualifying purchases.