+

Search Tips   |   Advanced Search

Usage model for using ActivitySessions with HTTP sessions

This topic describes how a Web application that runs in the WebSphere Web container can participate in an ActivitySession context.

If the Web application is designed such that several servlet invocations occur as part of the same logical application, then the servlets can use the HttpSession to preserve state across servlet invocations. The ActivitySession context is one state that can be suspended into the HttpSession and resumed on a future invocation of a servlet that accesses the HttpSession.

An ActivitySession is associated automatically with an HttpSession, so can be used to extend access to the ActivitySession over multiple HTTP invocations, over inclusion or forwarding of servlets, and to support EJB activation periods that can be determined by the lifecycle of the Web HTTP client. An ActivitySession context stored in an HttpSession can also be used to relate work for the ActivitySession back to a specific Web HTTP client.

The Web container manages ActivitySessions based on deployment descriptor attributes associated with servlets in the Web application module. The two usage models are:

A Web application can invoke servlets configured for either usage model.

The following points apply to both usage models:


Related concepts

  • ActivitySessions, global transaction contexts, and local transaction containment
  • The ActivitySession service programming interfaces


    Related tasks

  • Configure Web module ActivitySession deployment attributes

    1 Resetting an ActivitySession causes all the resources involved in the current ActivitySession to be rolled back to the last point of consistency, but allows further work within the ActivitySession. When the reset completes, the thread is associated with the same ActivitySession as it was before the reset was called. The ActivitySession resources remain associated with the ActivitySession although they cannot participate further in the ActivitySession Reference topic