Accessing client context regardless of application model
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
OpenEdge supports the ClientContextId property
on the Progress.Lang.OERequestInfo class that you can
use to identify client context for both session-free and session-managed applications,
especially in multi-tier application environments. OpenEdge provides instances of this
class that you can reference using attributes of both the ABL client's server object
handle and the PAS for OpenEdge session's SESSION system
handle.
OpenEdge creates one instance of OERequestInfo when
the client creates a server object handle and assigns the REQUEST-INFO attribute
to the object reference. OpenEdge also initializes the ClientContextId property
on this instance with a globally unique value that the client application
can change, if necessary, before each remote request using the same
server handle.
When the client makes a remote request on this server handle, the values of
this property and other properties of OERequestInfo are
sent to the PAS for OpenEdge session, where it initializes the same properties in a separate
instance of OERequestInfo that is referenced by the
CURRENT-REQUEST-INFO attribute on the session's
SESSION handle. When the server session completes
its handling of the request, it returns the OERequestInfo property values to the client that are set in the instance
referenced by the CURRENT-RESPONSE-INFO attribute. Some
of these values are different from those available through the CURRENT-REQUEST-INFO attribute, but the ClientContextId property value is the same unless your session code
changes it prior to returning to the client.
When the remote request returns a response to the client, the client code can
read the property values returned from the server in an OERequestInfo instance referenced by the RESPONSE-INFO attribute on the server object handle (or on the
asynchronous request object handle returned for an asynchronous request).
For each subsequent client request on the same server handle, OpenEdge
initializes the ClientContextId property on the REQUEST-INFO attribute instance from the ClientContextId value on the RESPONSE-INFO attribute, unless the client application changes the value
prior to the request. In this way, a ClientContextId
value can be propagated between the same client and PAS for OpenEdge instance with little or
no code intervention.
Typically you use the client context identifier
value set for the ClientContextId property to key a
context store that is initialized at the start of a user login session and shared
between the client and all servers that participate in the same login session. For more
information on using the ClientContextId and other
properties of the Progress.Lang.OERequestInfo class,
especially on the server, see Manage client context for session-free and unbound session-managed connections. The following section describes use of these properties on the
ABL client.