Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Activation group deleted on service program error?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Activation group deleted on service program error?

    I have a problem I didn't expect, and I'm looking for help in fixing it. I have an ILE program compiled with activation group *CALLER, which is called in the default activation group. It calls a service program which is compiled to run in activation group PICKLINE. It's the only program compiled to run in the activation group. The single module in the service program is compiled to release level V5R2M0. When a procedure in the service program encounters an unhandled exception, the error is passed back to the calling program, which dies an untimely death. Here's where it gets interesting: when I cancel the called program, the activation group PICKLINE is deleted! If I then call the program and it attempts to call a procedure in the service program, it blows up with the error "Tried to refer to all or part of an object that no longer exists". Apparently, when the program ended abnormally, it held onto the memory address of the service program, but because the activation group was deleted, the program is no longer there. It does this even if I issue a RCLRSC to free up the allocations for the program. If I call a separate program that also accesses the service program, it recreates the activation group and runs fine, but the original program still blows up because the newly created activation group has a different number (as shown in DSPJOB OPTION(*ACTGRP)) and therefore a different memory address. My only options are a) sign off and sign back on, or b) recompile the program. Neither are really tenable for the end-users. Mind you, the actual error that's occuring is also mind-boggling, but that's a separate post.

  • #2
    Re:Activation group deleted on service program error?

    Lot's of strange things can happen when you attempt to call an ILE program in the default activation group. I would avoid it like the plague. Either change the ILE program to run in a named activation group, or use *new instead of *caller.

    Comment


    • #3
      Re:Activation group deleted on service program error?

      brianmay wrote:
      Lot's of strange things can happen when you attempt to call an ILE program in the default activation group. I would avoid it like the plague. Either change the ILE program to run in a named activation group, or use *new instead of *caller.
      Unfortunately, this service program is called from a large number of different places, and it's impractical to change them all to use a named activation group. I've been doing the "DFTACTRP(*NO) ACTGRP(*CALLER) for years with no issues, but this is the first time we've thrown a service program into the mix.

      Comment


      • #4
        Re:Activation group deleted on service program error?

        I had similar problems when first using ILE with OPM programs. And I understand the initial pains of having to support both. To emulate the results of RCLRSC, you could try using RCLACTGRP ACTGRP(*ELIGIBLE). This will close the files and reclaim the activation groups. There is one thing to note when you are calling this command. If you were to try it from within a program that is within the activation group you are reclaiming, it can not reclaim it because it is in it. So, you need to reclaim the activation groups from outside of the one that you are trying to reclaim. Put another way, you need to call the RCLACTGRP ACTGRP(*ELIGIBLE) command from the original program that is contained in the default activation group for this situation. I agree with the comment about strange things happen when you are using both the default activation group and ILE. Which adds to the frustration of trying to implement these new capabilities. But, maybe this will help you in handling this situation until you can avoid this situation. Enjoy, Tom

        Comment


        • #5
          Re:Activation group deleted on service program error?

          You really don't want to use *ELIGIBLE. It will reclaim some OS/400 activation groups too. If fact, if you prompt on RCLACTGRP, *ELIGIBLE is not listed as an option because IBM doesn't want us to use it. Use RCLACTGRP(PICKLINE) instead. Or call the sub-procedure with CallP(e) MyProcedure; to trap the error programmatically. Chris

          Comment


          • #6
            Re:Activation group deleted on service program error?

            I have been using this *ELIGIBLE option since I have been using ILE for the very reason that you have posted this message and I have never had a problem with it to recover from an unexpected error. There have been some very obscure situations that required me to sign off and sign back on, but at that point there were no other options any ways. But, they do not happen very often at all. Maybe once every two or three years, if that often... I have heard buzz about not using *ELIGIBLE, but I have never seen an official IBM document that states the discouragement of this option; with the exception of possibly trying to reuse resources of an activation group which has already been reclaimed. And in that case, the named activation group would also apply. If you have a service program that also accesses other activation groups, you would also have to reclaim those. And if you are using *NEW for your activation groups, this would create a different activation group each time. So, if you needed to handle any of these situations, *ELIGIBLE would fit the bill. But, reclaiming a named activation group by name will work, if you know the name of the activation group. In any case, the RCLACTGRP command is most likely the answer you are looking for, whichever way you chose to use it to reclaim activations groups after an unexpected error has occurred.

            Comment


            • #7
              Re:Activation group deleted on service program error?

              I'm actually glad you've never had a problem with *ELIGIBLE. Barbara Morris of the IBM Toronto RPG compiler team has: http://archive.midrange.com/rpg400-l.../msg00220.html . And Jon Paris/Susan Gantner call *ELIGIBLE deadly sin #5: http://www.ibmsystemsmag.com/ibmi/developer/7923p2.aspx . Perhaps you mean use *ELIGIBLE during testing, not in production. Chris

              Comment


              • #8
                Re:Activation group deleted on service program error?

                Hi Chris, Thanks for the information! If it was written by Barbara Morris, Jon Paris and Susan Gantner then it may as well have the official logo on it. I do used RCLACTGRP(*ELIGIBLE) extensively when I am debugging my programs interactively as a programmer. And I do use it in production, we write all of our programs in house and I use it when I am calling ILE programs from within the default activation group. Just to pursue this a little further, if you do not mind. I do see that Barbara may have disagreed with this option at one time, but also followed up by saying that if she did say that she was wrong. But, then also said that if you are having problems after that it would be best to save a bunch of debugging time by signing off and signing back on. Which I agree with 100%. And Jon Paris/Susan Gantner is explaining how you may be using packaged software that could be using Activation Groups that you are not aware of. Which I completely understand too. I just have to say that I totally appreciate you providing this additional reputable information. I am just trying to flush out the magic on why you should not use RCLACTGRP(*ELIGIBLE). I could see if you were having unexplainable errors, to just sign off. And if you are not aware of all of the activation groups that are being used, then you would want to be more selective. But, if you are just starting out with ILE, or if you are writing all of the applications yourself and are using it to support errors using OPM and ILE, do you know of any other reasons or have any personal experience that would help to provide reasons not to use it? I am only asking because I appreciate your input and information, just to make sure there is not anything else I am missing. I am enjoying discussing this with you, but the family is calling me to get off the computer. I look forward to hearing from you tomorrow. Thanks, Tom

                Comment


                • #9
                  There's no point in using RCLACTGRP

                  Thanks for the advice, but RCLACTGRP(PICKLINE) won't do anything, because as I said in the original post, the activation group was deleted when the service program ab-ended. So there's nothing to reclaim! The question is, how do I get the OPM program object to re-initialize its object references on the second and subsequent calls?

                  Comment


                  • #10
                    Re:Activation group deleted on service program error?

                    Tom, I've never had a problem with *ELIGIBLE because I don't use it. I defer to the experiences of Morris, Paris, Ganter, et al. And I would work on the root cause of this problem (the service program failing) if I were the original poster. Wrap the procedure calls in MONITOR or a CALLP(E) and so forth. Or perhaps it's accessing/modifying memory it should not be like beyond the allocated length of a variable or array. Chris

                    Comment


                    • #11
                      Re:Activation group deleted on service program error?

                      Kengle, Here are some notes from the ILE programmers guide:
                      The storage associated with ILE programs running in the default activation group via *CALLER is not released until you sign off (for an interactive job) or until the job ends (for a batch job).
                      and
                      For ILE programs or service programs that were activated into the OPM default activation group because they were created with *CALLER, files will be closed when the RCLRSC command is issued. For programs, the storage will be re-initialized; however, the storage will not be released. For service programs, the storage will neither be re-initialized nor released. Note: This means that if you have a service program that ran in the default activation group and left files open, and a RCLRSC is issued, when you call the service program again, the files will still appear to be open, so so any I/O operations will result in an error.
                      I understand that sometimes you need to support real world situations that are not recommended, so maybe we could find a way to work around it until then. You said you have been using this ILE program for years without problems. So, perhaps the addition of the service program is preventing the recovery. Or maybe it could just be the exception. But, it looks like you will need to bring your ILE program outside of the Default Activation Group if you wish to recover without signing off. I understand that you wish to support this issue without having to modify all of the programs that are calling it and that you also do not wish to require the user to sign on and sign off. If you give a bit of information on the reasons for using *CALLER, I could give some possible creative answers that I have come up with to get around this without having to change all of the programs that are calling it.

                      Comment


                      • #12
                        Re:Activation group deleted on service program error?

                        Chris, I do recognize the information that you have provided and the sources that have provided that information, and this is completely applicable in an ILE-ONLY world. But I am not just an ILE programmer, I am also an OPM programmer and understand the process of supporting both at the same time. As you can tell by my avid support of both fixed and free formatted coding examples in most of my articles. The DAG (Default Activation Group) was created to support OPM programs when ILE was introduced. So theoretically, the OPM programs that continue to be supported in the DAG have no concept of activation groups. With this approach in mind, it would cause no harm to use *ELIGIBLE to reclaim all of the activation groups at the point of entry into the ILE world from the OPM world, because theoretically at this point activation groups do not exist to the OPM programs anyways and there is no possibility that any residual existing resources would attempt to reference the activation groups that have been reclaimed. So, this would satisfy the comments made in the ILE sins list of Jon Paris and Susan Gantner. The comment by Barbara Morris says that it saved her time when debugging applications. So, it would be apparent to me that she did use it to "reset the environment", otherwise she would not have experienced the debugging pains of using it. I totally respect the comments of these talented people and they are not just comments, they are facts. But, taking these facts into consideration, you could also use them in real world situations. I have used this functionality and am speaking from experience. If you use the *ELIGIBLE option with the knowledge of the warning from the experts, you can apply it in the correct manner, with the knowledge to be aware to the potential problems you may encounter. I am not one to stop at an answer that requires an extensive program rewrite to support a single obstacle. And I am also not one to give advice without first experiencing it myself. Most of the topics discussed in this forum violate the ILE sins list, but sometimes in the real world you still have to support it anyways. I believe a friendly debate about the use of a particular option can help to explore both sides of the coin and is a good way to examine all of the possibilities. Thank you for increasing the value of this forum as a resource for the future, Tom

                        Comment


                        • #13
                          Re:Activation group deleted on service program error?

                          Tom, That's all fine and dandy. You're original post about using *ELIGIBLE had zero warnings in it. That concerned me. This thread does now. So, everyone, use *ELIGIBLE with caution. But now, back to my other statement about fixing the root cause of the problem. What if the sub-procedure had a divide by zero error in it? Would you still recommend RCLACTGRP(*ELIGIBLE)? I doubt you would. You would say fix the divide error, wrap an "If ( Divisor <> 0 ) ;" around it or something similar right? Chris

                          Comment


                          • #14
                            Re:Activation group deleted on service program error?

                            Hi Chris, The original post states:
                            Mind you, the actual error that's occuring is also mind-boggling, but that's a separate post.
                            And the follow up post states:
                            The question is, how do I get the OPM program object to re-initialize its object references on the second and subsequent calls?
                            So, I was directly addressing those issues. All of the topics that we have covered in this forum have provided valuable information on Activation Groups and when and how to use them. There was some vagueness on both of our parts and we were able to explore all of the nuances in a forum environment. I really think this whole discussion was extremely useful. I wish I could have read this article when I first started using ILE! And to answer your question, Yes I would correct the error and monitor for exceptions. And yes, use *ELIGIBLE with caution. With the combination of your comments and mine, we have been able to provide some concrete examples of using activations groups and how to reclaim them in different situations. Thanks, Tom

                            Comment


                            • #15
                              Originally posted by kengle View Post
                              Thanks for the advice, but RCLACTGRP(PICKLINE) won't do anything, because as I said in the original post, the activation group was deleted when the service program ab-ended. So there's nothing to reclaim! The question is, how do I get the OPM program object to re-initialize its object references on the second and subsequent calls?
                              If you're trying to get an OPM program to re-initialize, RCLRSC would be more helpful. As OPM always runs in the *DFTACTGRP, it can't be reclaimed by RCLACTGRP.

                              Comment

                              Working...
                              X