Try OpenEdge Now
skip to main content
Developing AppServer Applications
Design and Implementation Considerations : Distributed application design and implementation : Cleanup of remote procedure instances
 

Cleanup of remote procedure instances

Persistent, single-run, and singleton procedures differ significantly with respect to the removal of instances from the AppServer. You should code your application with the following behavior in mind:
*Persistent procedures — Simply delete the proxy handle on the client. This causes the remote instance to be deleted.
*Single-run procedures — The remote instance is automatically deleted after execution of each call to an internal procedure or user-defined function. The client should delete the local proxy handle.
*Singleton procedures — The remote instance must be explicitly deleted, typically by code within the remote procedure itself. Otherwise, the instance remains in memory, even after the client disconnects, until the AppServer agent shuts down. The client should delete the local proxy handle, but doing so does not affect the remote instance.
The behavior described above varies slightly if any client calls a remote procedure with RUN SINGLE-RUN while the singleton instance of the same procedure is already running. In such a scenario, the AVM deletes the singleton instance and runs the procedure in single-run mode. The AVM does not re-instantiate the singleton until it is explicitly called by a client. Note that combining single-run and singleton calls to the same procedure within the same application is not recommended.