When a lock wait time out occurs on the AppServer because of a lock conflict that exceeds the time specified by the Lock Wait Timeout (-lkwtmo) startup parameter, a STOP condition is raised on the client side.
You cannot trap this stop condition simply by checking ERROR-STATUS:ERROR for a RUN statement that executes a remote procedure. The only way to handle this situation is to use the ON STOP phrase, as shown in this code fragment, as shown:
RUN testlkwtmo. MESSAGE RETURN-VALUE VIEW-AS ALERT-BOX.
PROCEDURE testlkwtmo:
DO ON STOP UNDO, RETURN "STOP occurred":
DEFINE VARIABLE hServer AS HANDLE NO-UNDO.
DEFINE VARIABLE lFlag AS LOGICAL NO-UNDO.
/* Invoke procedure on the server that locks records. */
CREATE SERVER hServer.
hServer:CONNECT("-AppService asbroker1 -H localhost").
RUN lockrecords.p ON SERVER hServer (OUTPUT lFlag) NO-ERROR.
If lockrecords.p terminates on the AppServer because of a lock wait time out, the AppServer raises a STOP condition on the client. The client program flow never reaches the message following the RUN statement that executes lockrecords.p, However, the client can catch the STOP condition and handle character string returned in RETURN-VALUE.