Kbase P28872: Trap AppServer lock wait time out with ON STOP Phrases
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/30/2010 |
|
Status: Verified
GOAL:
How to trap a remote AppServer lock wait time out on the client side?
GOAL:
How to handle Lock wait timeout of seconds expired (8812)
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1x
FIX:
When a lock wait time out occurs on the AppServer (due to a lock conflict that last too long see -lkwtmo startup parameter to change default of 30 minutes), a STOP condition is raised on the client side.
We cannot trap this stop condition by checking ERROR-STATUS:ERROR next to a RUN MyProc ON SERVER NO-ERROR. The only way to handle this situation is to use the ON STOP Phrases, as illustrated bellow:
RUN testlkwtmo.
MESSAGE RETURN-VALUE
VIEW-AS ALERT-BOX INFO BUTTONS OK.
PROCEDURE testlkwtmo:
DO ON STOP UNDO, RETURN "STOP occurred":
DEFINE VARIABLE flag AS LOGICAL NO-UNDO.
DEFINE VAR sh AS WIDGET-HANDLE. /* Server handle */
CREATE SERVER sh.
sh:CONNECT("-AppService lto -H localhost").
RUN AS.p ON SERVER sh (OUTPUT flag) NO-ERROR.
MESSAGE "flag :" flag SKIP
"ERROR-STATUS:ERROR :" ERROR-STATUS:ERROR
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END.If the as.p procedure is terminated on the AppServer because of a lock wait time out, then a STOP condition is raised. The flow of the program never reaches the message after the RUN, however, the calling program will catch the stop condition and will be able to handle the RETURN-VALUE.