It depends on the overall architecture that must be assessed.... but, never tried in this context, but, as a general idea to throw around, if you run a particular named activation group, you can run in the controlling top program a reclaim (RCLACTGRP ACTGRP(MYSRV001) ) when some condition arise (parameter, "refresh command", once some condition change etc.), this should unload the program resources and force a reload.
*NEW ACTGRP, again depending on performance , architecture etc. should produce also this effect.
Can be unrelated, and I was not using service program here, but just to open the discussion... I had a "service/daemon" program that had to run continuously unattended in a loop (drove a screen slideshow on a big screen showing info 24h/24h) in a job, I was using this strategy to force program swap consistently in the context of default vanilla program groups environment... only way I was able to swap it consistently... basically PGM001 was doing nothing, PGM002 what was driving things and I could hot swap it when needed keeping the slideshow process up..
P.S. shame that even an IBM forum (!) doesn't have the option to format as RPG a code sample... bah... ;PPP
DCL-PR pgmToCall EXTPGM(PgmName);
END-PR;
DOW *ON AND NOT %SHTDN;
pgmName = 'PGM001';
pgmToCall();
pgmName = 'PGM002';
pgmToCall();
ENDDO;
------------------------------
--ft
------------------------------
Original Message:
Sent: Fri October 11, 2024 02:18 PM
From: Christian Larsen
Subject: Trying to close a "remote" activation group.
Hello everyone!
The question:
We have a job running, which starts at the request of apache (it is a "REST service"). This job starts, but never ends, because from that job, different calls are made to different programs...
Well ... some of those programs that run in this "job" are using service programs, which remains in memory.
The problem I have is ... when I want to modify one of these service programs... what is the best way to proceed? I know one of them is closing those jobs ... but, is there any other better way??
Thank you!
------------------------------
Christian Larsen
IBMi RPG Analyst/Developer
Mayoral Moda Infantil, SAU
Málaga
+34 661627947
Spain
------------------------------
#RPG