*NEW- The name for this activation group is selected by ILE and will always
be unique. System-named activation groups are always deleted when the high
level language returns.
*CALLER - Specifying *CALLER causes the ILE program or service program to
be activated within the activation group of the calling program. A new
activation group is never created with this attribute.
*NEW is the standard behavior that can be expected on other systems such as
UNIX
®
.
Notes:
1. When you create a persistent CGI program, you must specify a named
activation group.
2. CGI programs that are not persistent should not refer to job-level scoped
resources.
For additional information about activation groups see, ILE Concepts, SC41-5606
book.
CGI Considerations
There are advantages to running CGI programs in either a user-named or
*CALLER activation group. The performance overhead associated with activating a
CGI every time that is requested can be drastically reduced. It is important to
understand that because the system does not delete user-named activation groups,
normal high level language end verbs cannot provide complete end processing. For
example, the system will not close open files, and the system will not return the
static and heap storage that are allocated by a program. The program must manage
these resources explicitly.This will be especially important when moving CGI
programs that rely on end processing to function properly.
Note: When you activate multi-threaded CGI on your web server, you get multiple
thread support for your CGI application Your CGI application must end all
of its threads before returning to the server. When using multi-thread
capable CGI, you need to put the CGI program in a new or named
activation group.
The following section shows examples which will work fine running in a *NEW
activation group, however will cause problems if run in a user-named or *CALLER
activation group.
Activation Group Problem Examples
Note
The following examples are not general CGI programming examples. For
general CGI programming examples, see Chapter 6. Sample programs (in
Java, C, and RPG)on page 89.
In the following example a CGI program when run in a *NEW activation group,
would write Hello World to the browser.What is important to understand is that
this application is taking advantage of job end processing to delete the stdio
buffers that are used to buffer the stdout data.
You could build the following CGI program to run in either a user-namedor
*CALLER activation group. In such an instance, the server will not process the
18 WebProgramming Guide V4R5