Managing application state across an HTTP request sequence

CICS® initiates a new alias transaction and a new program for each request made by a web client. This initiation is for pipelined requests, requests made using a persistent connection, and requests that form a logical sequence, and for individual stand-alone requests. Consider how the application state will be managed between requests.

About this task

To share data across the request sequence, between different programs or instances of the same program, use CICS-managed resources or elements of the requests sent by the web client.

When more than one exchange of a request and response between a web client and CICS is needed to complete a task successfully, the web client initiates each new step in the sequence. You can design the response sent by CICS to guide the web client, and any human user of the web client, to the next step. For example, the entity body can contain controls, such as links or buttons, with which the user can compose the next request. However, you cannot easily enforce the correct sequence of requests. In particular, the planned sequence can be disrupted for these reasons:
  • The client is a web browser, and the user types a known URL to initiate a particular request, rather than selecting a control in an HTML page provided by a previous response.
  • The user abandons the activity, by shutting down the web client or by changing to an alternative activity with the web client.
The user might also delay initiation of any request in the sequence.

You must design your application programs so that they can cope with delays or disruptions in the request sequence. For example, if you are sharing data across the request sequence, ensure that the data is cleaned up if the request sequence does not complete or is delayed excessively. If your application programs update protected resources, ensure that updates that must be committed or backed out together are made in the same transaction. So you must design a single request from the web client to complete the update.

The best situation for an application is that each exchange of a request and response is self-contained and completes an independent element of the task. However, this design is not always possible, especially when the task is complex, or when a web client has sent a pipelined sequence of requests. You might require a pseudoconversational model, in which the application state must be managed between requests. Use the following techniques:

Procedure



dfhtl_appsweb_otherprogs.html | Timestamp icon Last updated: Monday, 5 June 2017