[Version 5.0.2 and later]Assembling so that session data can be shared

Why and when to perform this task

In accordance with the Servlet 2.3 API specification, by default the session management facility supports session scoping by Web module. Only servlets in the same Web module can access the data associated with a particular session. WebSphere Application Server provides an option that you can use to extend the scope of the session attributes to an enterprise application. Therefore, you can share session attributes across all the Web modules in an enterprise application. This option is provided as an IBM extension.

Restriction: To use this option, you must install all the Web modules in the enterprise application on a given server. You cannot split up Web modules in the enterprise application by servers. For example, with an enterprise application containing two Web modules, you cannot use this option when one Web module is installed on one server and second Web module is installed on a different server. In such split installations, applications might share session attributes across Web modules using distributed sessions, but session data integrity is lost when concurrent access to a session is made in different Web modules. It also severely restricts use of some session management features, like TIME_BASED_WRITES. For enterprise applications on which this option is enabled, the session management configuration on the Web module inside the enterprise application is ignored. Then session management configuration defined on enterprise application is used if session management is overwritten at the enterprise application level. Otherwise, the session management configuration on the Web container is used.

Servlet API Behavior: If shared HttpSession context is turned on in an enterprise application, HttpSession listeners defined in all the Web modules inside the enterprise application are invoked for session events. The order of listener invocation is not guaranteed.

Do the following to share session data across Web modules in an enterprise application:

Steps for this task

  1. Start the Assembly Toolkitor Application Assembly Tool (AAT).
  2. In the Assembly Toolkit, right-click the application (EAR file) you want to share and click Open With > Deployment Descriptor Editor. In the AAT, click the EAR file that you want to share and click IBM extension tab.
  3. In the application deployment descriptor editor of the Assembly Toolkit, select Shared session context under WebSphere Extensions. In the AAT, click IBM extension tab > Shared httpsession context > Apply. Make sure the class definition of attributes put into session are available to all Web modules in the enterprise application.
    The shared session context does not fully meet the requirements of the Specifications.
  4. Save the application (EAR) file. In the Assembly Toolkit, after you close the application deployment descriptor editor, confirm that you want to save changes made to the application.

Related concepts
Session management support
Related reference
Problems creating or using HTTP sessions



Searchable topic ID:   tpersshardate
Last updated: Jun 21, 2007 4:55:42 PM CDT    WebSphere Application Server Network Deployment, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tprs_sharing_data.html

Library | Support | Terms of Use | Feedback