Home > AS/400 Tips > iSeries administrator tips > Understanding the ins and outs of activation groups -- Part I
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Understanding the ins and outs of activation groups -- Part I


Ron Turull
07.23.2003
Rating: -4.49- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


When you break it down, the Integrated Language Environment (ILE) is nothing more than a new program run-time environment, a new model for how the system executes programs. The compilers made for ILE (C, CL, COBOL and RPG) create programs that will execute in this new run-time environment, but the compilers themselves are not technically part of ILE. It you were forced to embody ILE in a system object, that object would most certainly be the activation group.

Activation groups are an AS/400 programmer's dream come true. Activation groups provide programmers with tremendous application design flexibility. As designed, an ILE program could not run without activation groups. An activation group's sole purpose is to help run ILE programs. They are truly the foundation of ILE and it is, therefore, very important to thoroughly understand what these things do and to know how to control them before tackling any major ILE development.


[IMAGE]
[IMAGE][IMAGE]
Ron Turull [IMAGE]
[IMAGE]

Activation groups can also be an administrator's worst nightmare. An improperly designed application can spawn dozens of activation groups, end normally, and leave all those activation groups open, locking up precious resources. Multiply that scenario by hundreds of users and you have the makings of an administrator's headache.

Activation group: A definition

If you are familiar with the function of a job's process access group (PAG), you are already familiar with at least the basic function of an activation group. An activation group is a chunk of system memory and other resources dedicated to a specific job for the purpose of executing programs. It is a substructure of the job to which it is assigned and contains the following resources:

  • Memory for static and automatic program variables. Static variables retain their values and memory locations from one call to the next. Automatic variables lose both their values and memory locations when the procedure that contains them ends; if the procedure is called again, its automatic variables are assigned new memory locations and are initialized anew. Support for automatic variables in RPG procedures was implemented in V3R2.
  • Memory for dynamic storage. Dynamic memory gives you the ability to dynamically create, delete and change the size of "variables." For instance, say you need to use an array in a program, but you cannot predict the number of elements you will need. Dynamic memory lets you allocate space for the array (essentially determine the number of elements) at run-time. If, while the program is executing, you need more elements, no problem -- simply reallocate (i.e., change the size of) the memory, while leaving intact any existing data already in the array. Dynamic memory is new to many AS/400 programmers, but it has always been available on the AS/400 to C and MI ...

    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    Application Development
    iSeries calling an .exe
    Top 10 programmer tips
    Formatted work job scheduler
    Convert system date and time
    Mixing free format code with embedded SQL
    SQL update a field in one file from a field in another file
    Webcasts for iSeries programmers
    Programming advice from the pros
    Easy code copying via the drag and drop method
    Setting FTP time-outs

    Systems Management
    Can you trust all those trigger programs?
    Are your backups complete?
    Controlling remote command processing
    Watch your profiles
    Avoid locking issues
    Send message to users at a remote site
    Security journal receiver management
    Top 10 backup commands
    Tracking critical file access in real time
    Create an iSeries Access image and update it with the latest Service Pack

    iSeries administrator tips
    Translating Linux for IBM i admins: Using GUI to make it easy
    Translating Linux for IBM i admins: Working with jobs and networking
    OpenOffice: What to know before making the transition from Microsoft Office
    OpenOffice: An enterprise open source solution
    Database performance comparisons on IBM i
    Translating Linux for IBM i admins: User profile commands
    Modern System i reports using Client Access
    Tips for installing Lotus Domino server on a System i partition
    The iSeries Blog has a new home on IT Knowledge Exchange
    Virtualization for IBM i: Backups

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary


    programmers.

  • Temporary data management resources. These are temporary objects created by the data management subsystem on behalf of a program. For example, when you open a file, data management creates an open data path (ODP) "object" that "links" the file to the program. Other things that rely on data management resources include commitment control definitions, local SQL cursors, hierarchical file systems, user interface manager (UIM), query management (QM) and communication links such as CPI-C connections.
  • Resources needed for exception handlers and other exit points. These give you the ability to add a tremendous amount of flexibility to your applications. You can create a standard exception handler and attach it to all your activation groups. You can also attach an exit program to an activation group that will be called automatically before the activation group "ends."

All those resources are kept separate for each activation group, allowing you to isolate applications in activation groups. When an activation group is deleted, all its resources are freed up and returned to the system.

Two types of activation groups

There are two basic types of activation groups, ILE and non-ILE (the latter is called the default activation group).

  1. Default activation group (non-ILE activation group). Every job has a default activation group. It is automatically created when the job starts and destroyed when the job ends. You cannot manually create or destroy the default activation group. Its main purpose is to run non-ILE (i.e., OPM) programs, although you can, with some limitations, have ILE programs run in the default activation group as well. It is the only activation group that can run non-ILE programs.
  2. ILE activation group. You create ILE activation groups and are responsible for deleting them (although the system will delete all of a job's activation groups automatically when the job ends). ILE activation groups come in several flavors, which we'll discuss in Part II.

In the next installment, we discuss how to control activation groups, the different types of activation groups, and some strategies for using them effectively and efficiently.

-----------------------------------
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years experience programming for and managing AS/400-iSeries systems.

==================================
MORE INFORMATION
==================================

  • How do you use activation groups?
    One Search400.com member said activation groups seem like a nice feature but that they require more effort than they're worth. How can they be used, he wondered. A few other users described what they use them for and pointed out their benefits.
  • The trouble with Reclaim Resources
    It isn't uncommon for an application to execute the Reclaim Resources command (RCLRSC) periodically as a "garbage-collecting" device to improve performance. And programs sometimes rely on the command to free static memory, close open files and free other resources. But watch out if you need to have the program start fresh and execute a RCLRSC in the calling program before calling the RPG program. The RCLRSC command will not work if you convert the whole thing to ILE and tell it to run in an activation group other the default.
  • Ten important things to remember about heaps
    Memory for dynamic variables is allocated off an internal structure called the "heap." The heap is simply a chunk of memory that the system allocates for an activation group when the activation group is created. The Alloc, Dealloc, and Realloc op-codes are pretty straight-forward once you understand a few things about heaps.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts