Try OpenEdge Now
skip to main content
Developing AppServer Applications
Programming the AppServer : Using AppServer configuration procedures : Connect and Disconnect procedures : Usage requirements
 
Usage requirements
You can specify Connect and Disconnect procedures for all three AppServer operating modes (state-reset, state-aware, and stateless).
If the AppServer operating mode is state-reset or state-aware, the Connect procedure runs as a persistent procedure. If the AppServer operating mode is stateless, the Connect procedure runs as a non-persistent procedure. The Disconnect procedure runs as a non-persistent procedure in all operating modes.
If the Connect procedure is executed as a persistent procedure, and you do not need its context, you can delete it by executing the DELETE PROCEDURE (or DELETE OBJECT) statement on the procedure handle associated with the Connect procedure. If the AppServer operating mode is state-reset, the persistent Connect procedure is automatically deleted when a new connection is assigned to the AppServer agent.
Note that if the AppServer is running in stateless operating mode, there is no guarantee that the AppServer agent that runs the Connect procedure for the client application will be the same one that actually processes requests for the client application. Thus, any context that a Connect procedure establishes for a stateless connection must be stored in a file, database, SERVER-CONNECTION-CONTEXT attribute of the SESSION handle (see Managing stateless connection context), or some other resource that is accessible through ABL.
Note that both the Connect and Disconnect procedures are optional. There is no requirement to specify either or both of them. Additionally, the content of these procedures is completely application specific, and the AppServer architecture places no constraints on it. Any ABL logic that is valid within an AppServer agent is valid for these procedures.