Consultor Eletrônico



Kbase P107860: Why does application restart after receiving 4GL STOP condition?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/2/2008
Status: Verified

GOAL:

Why does application restart after receiving 4GL STOP condition?

GOAL:

How to properly handle a 4GL STOP condition?

GOAL:

Why does my application continually restart?

FACT(s) (Environment):

All Supported Operating Systems
Progress 6.x
Progress 7.x
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

When a 4GL application is run from the command line using the -p startup parameter it is possible to get into what the user would consider to be a loop. This "loop" causes the program specified in the -p startup parameter to constantly re-run. This is expected behavior and is caused when something in the code causes a 4GL STOP condition to be raised. When the STOP condition is raised the Progress Runtime Engine walks of the call stack trying to find an existing DO ON STOP or REPEAT ON STOP block which can handle the STOP condition. If no such block is found the default behavior is to simply restart the application which is what the user sees (and often considers to be a loop).
The best way to resolve this is to ensure that the application properly handles all cases where a STOP condition can be generated. This is normally accomplished by using the DO ON STOP or REPEAT ON STOP statement blocks around code which can cause the STOP condition.
A brute force way of resolving this problem is to write a simple 4GL program like the following which wraps the entire application within a default DO ON STOP block. When the problem is handled in this manner any unhandled STOP conditions within the application itself will be caught by this DO ON STOP block and it will terminate the application.
DO ON STOP UNDO, RETRY:
IF RETRY THEN
DO:
MESSAGE 'Unhandled Stop Condition Raised, Terminating Application' VIEW-AS ALERT-BOX.
QUIT.
END.
RUN MainApplicationProgram.p.
END.