The Activate procedure executes immediately before a remote procedure request when the connection is session-free or session-managed in the unbound state. A typical use of Activate procedures for unbound session-managed connections is to retrieve connection context using an application-specific context database or the
SERVER-CONNECTION-CONTEXT attribute on the
SESSION handle (see
Managing context for bound and unbound session-managed connections). Using the
SERVER-CONNECTION-ID attribute, you can uniquely identify (key) the context in the context database. You can then retrieve the connection-identified context from the context database or unmarshal it from the
SERVER-CONNECTION-CONTEXT attribute value. You can create the initial context for the connection using the Connect procedure. For more information, see
Connect and Disconnect procedures.
For either session-free or unbound session-managed connections, you can also retrieve client connection context that might be keyed on the value of the
ClientContextId property of the
Progress.Lang.OERequestInfo class. From the Activate (or any other PAS for OE instance) procedure, you can access this property on the
OERequestInfo object that is returned by the
CURRENT-REQUEST-INFO attribute on the
SESSION handle. For more information, see
Managing client context for session-free and unbound session-managed connections.
You can specify the name of an PAS for OpenEdge instance Activate procedure by setting the sessionActivateProc property in the PAS for OE properties file (openedge.properties). If you specify this procedure, it accepts no parameters and runs as a non-persistent procedure in any PAS for OpenEdge session that executes a remote procedure request for an session-free or unbound session-managed connection.
For the purposes of error handling, the Activate procedure is considered part of the remote procedure request. If the Activate procedure completes with no ABL termination condition (ERROR, QUIT, or STOP), the remote procedure executes immediately afterward. If the Activate procedure completes with a termination condition, it returns to the client application as if the remote procedure had generated the termination condition. Any return values (using the RETURN[ERROR]string statement) are passed to the client and the original remote procedure request is not executed.