Try OpenEdge Now
skip to main content
Developing AppServer Applications
Programming the AppServer : Using AppServer configuration procedures : Activate and Deactivate procedures : Activate procedure
 
Activate procedure
The Activate procedure executes immediately before a remote procedure request when the connection is in the unbound state. A typical use of Activate procedures is to retrieve connection context using an application-specific context database or the SERVER-CONNECTION-CONTEXT attribute on the SESSION handle (see Managing stateless connection context). 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 unmarshall 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 Connectand Disconnect procedures.
In either state-free or stateless operating mode, 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 AppServer) 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 state-free and stateless client context.
You can specify the name of an AppServer Activate procedure using the OpenEdge Explorer or OpenEdge Management or by setting the srvrActivateProc property in the AppServer properties file (ubroker.properties). If you specify this procedure, it accepts no parameters and runs as a non-persistent procedure on any AppServer agent that executes a remote procedure request for an unbound connection.
Note: The Activate procedure only runs prior to remote procedure requests. It does not run in response to connection or disconnection requests.
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.