Try OpenEdge Now
skip to main content
Developing AppServer Applications
AppServer and Client Interaction : Understanding AppServer operating modes : Stateless operating mode : Context management
 
Context management
An AppServer running in stateless operating mode does not reset its session context between client connections. Instead, it maintains almost all context created in an AppServer session until a particular AppServer agent terminates or the context is changed by some procedure running in the AppServer session.
For an AppServer running in stateless operating mode you can also configure Startup and Shutdown procedures that run in every AppServer session when it starts up and shuts down. You can use these procedures to establish and discard run-time context that the AppServer maintains in common for all connections. For more information on the Startup and Shutdown procedures, see Programming the AppServer.
Using a bound connection, the AppServer maintains all session context created between client requests (similar to a state-aware AppServer), because the bound connection maintains one AppServer agent to execute all requests for the same connected client until you reset the connection to the unbound state.
Using an unbound connection, the AppServer does not automatically guarantee that context created during a remote procedure request will be available when the same client makes the next request. As noted in a previous section, this is because a stateless AppServer cannot guarantee that the same AppServer agent will handle the next request. However, you can still maintain context created between requests from a connected client, but only by explicitly saving the created context using one of several mechanisms.
Two such mechanisms specially supported for stateless AppServers include:
*The SERVER-CONNECTION-CONTEXT attribute on the SESSION handle that allows you to pass CHARACTER data from one request to another on the same client connection
*Activate and Deactivate procedures that you can configure to execute before and after each remote procedure request
For more information on these mechanisms, see Programming the AppServer.
As noted in a previous section, OpenEdge does not automatically delete any AppServer session context between requests to a stateless AppServer. The only exception to this is if a client application disconnects from a stateless AppServer while it has remote persistent procedures active in the AppServer session. In that case, OpenEdge does automatically delete the active remote persistent procedures before disconnecting the client application.