1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How do you get code to execute at the end of a procedure?

Discussão em 'StackOverflow' iniciado por fdantas, Janeiro 13, 2020.

  1. fdantas

    fdantas Administrator Moderador

    I'm working on a new piece of code at work to assist the rest of the programmers in making app server calls. Previously we just had a .i file and relied on the developer to make sure you made all the right calls and cleaned up the app server connection at the end of the program. Obviously some people have forgotten to do that in the past and it's caused problems for us.

    I've been building a basic appserver.cls file, but I can't figure out how to get it to disconnect at the end of the program.


    I've tried the following things so far.

    ON CLOSE OF THIS-PROCEDURE
    DO:
    clAppServer:cleanupAppServer().
    END.


    This doesn't seem to fire at the end of the webspeed call.

    DESTRUCTOR appserver():
    cleanupAppServer().
    END DESTRUCTOR.


    This works when it does garbage collection, but Progress doesn't seem to do garbage collection at the end of a webspeed call and the objects are still in memory (which is an entirely different issue that I need to deal with).

    ON CLOSE OF SESSION:LAST-PROCEDURE
    DO:
    clAppServer:cleanupAppServer().
    END.


    This doesn't even compile obviously.

    I've tried a whole bunch of other things that are variants on these three to no avail.


    Is there any way to do what I'm asking? Bonus points if it can be inside the appserver.cls file.

    Continue reading...

Compartilhe esta Página