Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Controlling WebSpeed Transactions : Understanding state-persistent transaction control

Understanding state-persistent transaction control

State-persistent transactions allow you to maintain active context on a single WebSpeed agent between requests by locking that agent to a single client. To support state-persistent transactions, WebSpeed uses an agent control program. This program executes whatever Web object is specified in the WebSpeed URL for a request. In so doing, it verifies the status of the Web object in any active transaction, locks the agent on behalf of the Web object that starts a transaction, and unlocks the agent on behalf of any Web object that terminates the transaction.
To lock an agent temporarily to a particular browser, you run the function setWebState, before HTTP header output. This procedure performs two basic functions:
*It sets cookies that allow the WebSpeed broker to identify the Web browser, the WebSpeed agent, and the Web object that are bound in the transaction.
The cookie settings also ensure that any subsequent WebSpeed request from the transaction-bound browser are serviced by the same locked WebSpeed agent.
*It sets a specified time-out period (in minutes) for the invoking state-aware Web object. This period is the maximum time that the Web user has between subsequent transaction requests before the transaction automatically terminates. The locked agent keeps track of this period for all state-aware Web objects that run in the current transaction.
The transaction-bound client can make other Web requests, including WebSpeed requests using other agents. However, the transaction clock runs while the browser is engaged with other requests. It can time-out if the user fails to continue the transaction within the specified time.
While the agent is servicing requests for a state-persistent transaction, requests made to the same URL by other client cannot be serviced by that agent until the current transaction terminates. The locked agent continues to service both state-aware and stateless requests from the transaction-bound client, as long as those requests use the same WebSpeed Messenger.
* How to make a Web object state-aware
* Web objects in stateless and state-persistent contexts