|
Hi Titus, > Should a trigger program wirtten in RPGLE end with LR on? I always end with *INLR = *OFF because the program will re-start faster which is important for triggers in my environment. > When ending with LR, I think it will be loaded in main storage for every > call. The will cost a lot of resources. That depends on the activation group. If it's running in the default activation group, then yes -- *INLR may unload it from memory. If it's created with ACTGRP(*NEW) then it'll always completely end, no matter how you specify *INLR, and if it's in a named activation group, then turning on *INLR will only cause the variables to be reinitialized -- the program will remain in memory until the actgrp is reclaimed. As I mentioned, I prefer to have my program remain active and not have to reinitialize the variables because it's the fastest way to do things -- so I specify ACTGRP('QILE') and *INLR=*OFF. > But when I do not end with LR, who ends the trigger program after doing > all updates to a physical file like an SQL UPDATE would do? The trigger program will end when you sign off or when the activation group is reclaimed. In most cases it does not make sense to unload a trigger program until you sign off. If you want to unload/reload it for testing purposes, then compile it with ACTGRP('MYACTGRP') and *INLR=*OFF, and then use RCLACTGRP MYACTGRP from the command-line when you want to unload it.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.