Hallo,

Code:
ILE ist deshalb besser, da du hier eine eigene ACTGRP definieren kannst um mit *INLR = *OFF den Trigger nicht ständig zu initialisieren.
Trigger (egal ob extern oder SQL) sollten niemals in einer eigenen/benannten Aktivierungsgruppe, sondern immer in Aktivierungsgruppe *CALLER laufen!

Grund ist Commitment Control und Transaktions-Sicherheit.
Ein Trigger hängt direkt an einer physischen Datei oder Tabelle (oder seit V5R4 an einer View). Es erfolgt ein Update in einem Programm in Aktivierungsgruppe X. Der Update aktiviert den Trigger in einer eigenen Aktivierungsgruppe Y. Update und Trigger-Aktion gehören zusammen, d.h. Update und Trigger müssen beide ausgeführt werden oder keines von beiden. Die Commitment-Steuerung ist mit Standard-Werten (also Commitment Scope *ACTGRP) gestartet.

Und jetzt ist ein Rollback erforderlich.
.... und der funktioniert nur innerhalb der Aktivierungsgruppe, in der er abgesetzt wurde!
... schade aber auch!

Auszug aus Redbook: Stored Procedures, Triggers and User Defined Functions (Kapitel 11.3.1. Commitment Control and Triggers):
To ensure the best level of data consistency, use commitment control in your applications. If your database design includes triggers, be aware of the implications of using commitment control for the resources accessed by the trigger programs. To avoid data integrity potential exposures, triggers and applications should share the same commitment definition. In this case, all the changes performed by triggers are committed or rolled back by the application
itself. The safest way to ensure that this happens is by compiling your triggers with ACTGRP(*CALLER). Triggers and applications should also share the same lock level.

If triggers run in a separate commitment control definition, they must commit or roll back their changes, since the application cannot do that. There are potential record-locking and consistency exposures in this situation. If the trigger terminates normally without committing its changes, the application cannot release the locks on those records.
Birgitta