Kunal Roy
Kunal Roy

Reputation: 787

What is the real advantage of using activation group in rpg

Can someone kindly tell me what is the real advantage of using an activation group. I mean other than the fact that we can deactivate a bunch of programs together what real advantage does activation group provide us over not using it.

Upvotes: 2

Views: 729

Answers (2)

PoC
PoC

Reputation: 591

Another real life example, from a different PoV: I'm a Hobbyist user and deliberately using and developing on a rather old and slow system.

Lately I've built a tiny ILE RPG application which just displays a screen of static strings you can put your cursor on and press help to get a nicely formatted help text panel.

I found DFTACTGRP(*YES) when compiling (instead of my default DFTACTGRP(*NO) ACTGRP(*NEW)) makes a seizable difference when starting that program. Running in the old style shared activation group saves CPU cycles. The same like you would observe when running in an already existing named activation group.

Upvotes: -1

Charles
Charles

Reputation: 23823

Prior to ILE Activation groups, every program ran in a given job shared certain resources, with activation groups these are shared only within an activation group.

I'll point you toward the ILE Concepts manual

All ILE programs and service programs are activated within a substructure of a job called an activation group. This substructure contains the resources necessary to run the programs. These resources fall into the following general categories: Static program variables Dynamic storage Temporary data management resources Certain types of exception handlers and ending procedures

The separation of these resources among activation groups supports a fundamental concept. That is, the concept that all programs activated within one activation group are developed as one cooperative application.

The temporary data management resources include the following:
Open files (open data path or ODP)
Commitment definitions Local SQL cursors
Remote SQL cursors
Hierarchical file system (HFS)
User interface manager
Query management instances
Open communications links
Common Programming Interface (CPI) communications

But what's the benefit you asked. Simple really, when working with applications and/or tools from various vendors, activation groups provide for segregation between them.

Let me provide a "real-life" example of activations groups saving the day. I was building a application that used Scott Klement's awesome HTTP API tooling. As is best practice, the *SRVPGM was defined with ACTGRP(*CALLER). My use case, PGMA, required maintaining a persistent connection to a given end point. However, periodically, I also needed to call PGMB which also used HTTP API to hit another endpoint. HTTP API isn't designed to support multiple connections at the same time. However, by simply running PGMA and PGMB is separate activation groups, I could get multiple copies of the HTTP API *SRVPGM activated and successfully connect to multiple endpoints at the same time.

Upvotes: 5

Related Questions