Try OpenEdge Now
skip to main content
Developing AppServer Applications
Programming ABL Client Applications : Accessing the connection ID on a session-managed client

Accessing the connection ID on a session-managed client

On a session-managed ABL client, a connection ID for an AppServer connection is available as the value of the CLIENT-CONNECTION-ID attribute on the server object handle for the connection. This is a read-only attribute of type CHARACTER that the AppServer generates for every session-managed client connection. For an Open Client application, OpenEdge provides appropriate common methods to access the connection ID (see OpenEdge Development: Open Client Introduction and Programming).
For a client, the connection ID of a given AppServer connection remains the same until the client disconnects from the AppServer. If the same client reconnects to the same AppServer, the connection ID of the new connection (and thus the value of the CLIENT-CONNECTION-ID attribute for that connection) is different from the connection ID of any previous connection. The CLIENT-CONNECTION-ID attribute works only on an ABL client running in a session-managed application.
The CLIENT-CONNECTION-ID value is also shared with the SERVER-CONNECTION-ID attribute on the AppServer SESSION handle. This value can therefore be used by both the client and AppServer to maintain a consistent client context especially with an AppServer running in stateless operating mode. This value can also be useful to provide a common audit trail ID for any AppServer and client in a session-managed application.
For information on how the AppServer generates this value, see Accessing the connection ID. For information on how to use this value to manage connection context, see Managing stateless connection context. For information on how to use this value in audit trails, see Audit trails.
Note: For an ABL client in a session-free application, the CLIENT-CONNECTION-ID attribute always has the unknown value (?) because there is no sustained physical connection to the AppServer in a session-free application. In order to maintain client connection context for an application regardless of session model, use the ClientContextId property on the Progress.Lang.OERequestInfo class. For more information on using this property, see Accessing client context regardless of session model.