Try OpenEdge Now
skip to main content
Application Migration and Development Guide
Application Development with PAS for OpenEdge : Programming ABL Client Applications : Managing asynchronous requests : Running asynchronous requests on the SESSION system handle
Running asynchronous requests on the SESSION system handle
You can execute a RUN...ASYNCHRONOUS statement using a server object handle or a SESSION system handle. If you use a SESSION handle, the request is executed synchronously on the client as if it was called using a synchronous RUN statement. However, unlike a standard synchronous procedure call that returns the results directly to the RUN statement, the results are returned by the event procedure specified on the RUN...ASYNCHRONOUS statement as though it were responding to a PROCEDURE-COMPLETE event from a server.
Thus, using the SESSION handle, the event procedure runs synchronously as part of the RUN statement and returns execution to the statement immediately following the same RUN statement. This is different from using a server handle, where the event procedure runs only in the context of a blocking I/O or PROCESS EVENTS statement that processes the PROCEDURE-COMPLETE event. However, this still allows you to use the RUN...ASYNCHRONOUS statement to program local and remote requests in a similar way, for example, when a server is not available.
Note: In addition to order of execution, using the SESSION handle to run an asynchronous request as a local synchronous request results in error handling that is slightly different from using a server handle. For this reason, you might want to develop using a local PAS for OpenEdge instance when a network PAS for OpenEdge instance is not available. For more information on running a local PAS for OpenEdge instance, see Progress Application Server for OpenEdge: Administration Guide. For more information on error handling when using the SESSION handle, see the RUN statement entry in OpenEdge Development: ABL Reference.