× 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.



Thanks Scott and everyone else for the advise. I'm convinced that *caller
is the way to go.

Rob

On Wed, Nov 4, 2020 at 2:13 PM Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

Rob,

Here are my thoughts:

1) Never use *NEW for a trigger or any other program thats intended to
run repeatedly.

2) You should almost always use *CALLER on a trigger. Imagine a
scenario where your trigger updates another table (file) or similar. If
it is not *CALLER, then those updates can run in a separate commit
scope, which means that you can't commit/rollback changes consistently.

3) The exception: If you know you will never use commitment control,
but you do have processes that use RCLRSC, and you use a service program
from your trigger, using *CALLER will be harmful because the service
program will go haywire after the RCLRSC if its run within the default
activation group.

4) My thoughts in (3), above, are an oddball scenario. A better fix
would be to eliminate the RCLRSC commands (it is 2020, after all, not
1989) as they will doubtless cause bigger problems. Its far more likely
(at least, HOPEFULLY, its more likely) that your shop will move more
towards modular programming and proper transaction handling with
commitment control vs. moving backwards towards 1980's style RPG
programming. So remove the RCLRSC, and use *CALLER.

-SK

On 11/4/2020 10:22 AM, Robert Rogerson wrote:
Hi All, I've been trying find how to define the activation group on an
external (RPG) database trigger.
Should I be using ctl-opt actgrp(*new) orctl-opt actgrp(*caller)?

If anyone knows of a link to a reference that would be great too.

Thanks,

Rob
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.