Kbase P46800: How to catch that no AppServer is available in 4GL?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  30/01/2009 |
|
Status: Unverified
GOAL:
How to catch the fact that no AppServer agent is available in 4GL?
GOAL:
How to catch No Server is available in 4GL?
GOAL:
How to catch Application server connect failure. (5468) in 4GL
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
FIX:
The AppServer Broker will reject the connection if no agent is available during a time defined in Progress Explorer/ AppServer/ Property/ Broker/ Advanced Feature/ Request timeout (requestTimeout key in ubroker.properties.file)
Here is a sample code to trap a request time out:
DEFINE VARIABLE hAS AS HANDLE NO-UNDO.
DEFINE VARIABLE mthRtn AS LOGICAL NO-UNDO.
DEFINE VARIABLE ietime AS INTEGER NO-UNDO.
CREATE SERVER hAS.
ietime = ETIME.
mthRtn = hAS:CONNECT("-S 5162 -H localHost -AppService sports2000") NO-ERROR. /* where sports2000 is the AppServiceNameList and 5162 is the NameServer port */
IF NOT mthRtn THEN DO:
MESSAGE "My own handling: No AppServer Agent available" SKIP
"I've been waiting for" ETIME - ietime 'ms' SKIP
ERROR-STATUS:ERROR SKIP
ERROR-STATUS:NUM-MESSAGES SKIP
ERROR-STATUS:GET-NUMBER(1) SKIP /*0*/
ERROR-STATUS:GET-MESSAGE(1) SKIP /*'No Server is available'*/
ERROR-STATUS:GET-NUMBER(2) SKIP /*5468*/
ERROR-STATUS:GET-MESSAGE(2) /*'Application server connect failure. (5468)'*/
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
ELSE DO:
RUN lockAs.p ON SERVER hAS.
hAS:DISCONNECT().
END.
DELETE OBJECT hAS.