Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Controlling WebSpeed Transactions : Advantages of using SERVER-CONNECTION-ID

Advantages of using SERVER-CONNECTION-ID

Using the SERVER-CONNECTION-ID attribute allows you to create a virtual session for your WebSpeed applications. You can maintain context between Web requests without tying up a WebSpeed Agent.
As described in Defining state, Web requests can be sent in a stateless mode or in a state-aware mode. In the stateless mode, web requests are independent of each other. No application context is maintained from one request to another. In state-aware mode, context is maintained by locking a WebSpeed agent to a particular client. State-aware mode has a scalability disadvantage because the locked agent is not available until a session is completed.
When you enable Session Connection ID, the WebSpeed Messenger checks incoming requests for a cookie containing a value for SERVER-CONNECTION-ID. The SERVER-CONNECTION-ID variable contains a unique identifier. If it does not exist, the WebSpeed Messenger causes a unique identifier to be generated. The WebSpeed Messenger then sets the SERVER-CONNECTION-ID attribute of the SESSION handle to the value of the unique identifier. (For more information, see OpenEdge Development: ABL Reference.) This unique connection identifier gets passed to the WebSpeed Agent as part of the Web request. In turn, the WebSpeed Agent passes the unique connection identifier to the WebSpeed application (also known as the Web object).
It is important to be aware that your Web object will not automatically associate the current request with a prior request even though it receives a unique connection identifier. You will need to create a data source where you can save connection identifiers and their associated application context. Then, you must create the logic in the Web object that:
*Determines if the connection identifier is new or if it already exists in your data source
*Creates a new entry in your data source if the connection identifier is new
*Restores application context if the connection identifier already exists in your data source
*Saves the changes in application context with the appropriate connection identifier before it completes execution