Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Controlling WebSpeed Transactions : Handling state-aware time-outs
 

Handling state-aware time-outs

A Web object time-out occurs when the time out period specified in a Web object's Web-Timeout attribute has expired. When this happens, an agent that was LOCKED changes its status from LOCKED to AVAILABLE and destroys the Web object in the process (as long as there are no other state-aware objects still active).
However, if a Web object times-out, but the agent is still LOCKED, the object's "Web-State" moves to "Timed-Out", but the object is not destroyed. You can still access the Web object while it is timed-out until the agent changes status to AVAILABLE. If you do not want this behavior, you can add the following code to process-web-request:
RUN get-attribute ("Web-State":U).
IF RETURN-VALUE eq "Timed-Out" THEN DO:
  RUN HtmlError IN web-utilities-hdl ("Object has timed out!").
  RETURN.
END.
In general, when the user submits a request from a page returned by a now timed-out Web object, the request contains HTML that includes a stale WSEU cookie. The Transaction Server returns the following message:
The Web object to which you were attached has timed out. Please start again.
If you receive a timed-out message, you can take one of three actions:
1. Set the Web-Timeout-Handler attribute of the state-aware Web object, which allows you to run another Web object (.w) or WebSpeed procedure (.p) when the state-aware Web object times-out.
2. Reset the time-out period for a state-aware Web object by overriding the default adm-timing-out event procedure.
3. Rely on the default time-out message from the WebSpeed Transaction Server.
* Using a Web object time-out handler
* Resetting a Web object's time-out period