For a session-free application, you cannot perform these functions at connect time at all, because the application never runs a Connect procedure. For session-free applications, setting an export list and database connections works much more effectively as a global activity that you implement in the Session Startup procedure, which executes for every server session 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 server session that handles a remote procedure request. The server session can retrieve and re-save the export list information for the next server session that handles the client using the Activate and Deactivate procedures.
Caution: Setting an export list during remote procedure requests from a session-free client 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 server using the session-managed model with a bound connection, instead.
To maintain consistent export list settings using the Activate and Deactivate procedures:
1. In the Session 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 context storage, such as a context database or operating system file.
This context storage must be accessible to all PAS for OpenEdge instances that handle requests distributed by a DNS load balancer for the same business application.
3. In the Activate procedure, retrieve the export list from your 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 re-save the reset export list to your context storage. This leaves the current or any other server session in any server that supports the same session-free application to handle future remote procedure requests, as appropriate.