Try OpenEdge Now
skip to main content
Developing AppServer Applications
Design and Implementation Considerations : Security considerations : AppServer session access : State-free operating mode
 
State-free operating mode
For a state-free AppServer, you cannot perform these functions at connect time at all, because the client maintains no physical connection to any one AppServer, and the AppServer never runs a Connect procedure. For state-free AppServers, setting an export list and database connections works much more effectively as a global activity that you implement in the Startup procedure, which executes for every AppServer agent when it starts up. However, note that the criteria for initializing the export list cannot easily be user-based, as there is no connected user.
You can pass request-based export list information to each AppServer agent that handles a remote procedure request. The AppServer agent can retrieve and resave the export list information for the next AppServer agent that handles the client using the Activate and Deactivate procedures.
Caution: Setting an export list during remote procedure requests to a state-free AppServer is an error-prone activity. If your application requires this fine degree of control, the rest of this section explains how you can do it. However, you might consider implementing your AppServer using state-aware operating mode, instead.
To maintain consistent export list settings using the Activate and Deactivate configuration procedures:
1. In the Startup procedure, establish an initial export list based on whatever criteria your application requires (for example, the time of day).
2. Save the initial export list using state-free context storage, such as a context database or operating system file. This context storage must be accessible to all AppServers registered to handle the same state-free application service.
3. In the Activate procedure, retrieve the export list from your state-free context storage and set it using the EXPORT( ) method. The list is now set to filter the current remote procedure call and ensure its validity according to whatever criteria you determine for the request.
4. In the Deactivate procedure, reset the export list to empty or to any other global session value using the EXPORT( ) method and resave the reset export list to your state-free context storage. This leaves the current or any other AppServer agent in any AppServer that supports the state-free application service to handle future remote procedure requests, as appropriate.