ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzatz_5.4.0.1/51/program/sesassemshare.htm

53 lines
3.3 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
<title>Assemble applications to share session data</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h5><A NAME="sesassemshare"></A>Assemble applications to share session data</h5>
<p>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 - Express 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.</p>
<p><strong>Restriction:</strong> 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.</p>
<p><strong>Servlet API Behavior:</strong> 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.</p>
<p>Perform these steps to share session data across Web modules in an enterprise application:</p>
<ol>
<li>Start the WebSphere Development Studio Client for iSeries (WDSc).</li>
<li>Import the EAR file if it does not already exist in the Workspace.</li>
<li>In the J2EE Perspective, expand <strong>Enterprise Applications</strong>, and right click the application you want to modify.</li>
<li>Select <strong>Open With --&gt; Deployment Descriptor Editor</strong>.</li>
<li>In the <strong>WebSphere Extensions</strong> section, select the <strong>Shared session context</strong> check box.</li>
<li>Click <strong>File --&gt; Save</strong>.</li>
<li>Verify that the class definition of attributes in the session are available to all the Web modules in the enterprise application.</li>
<li>Export the EAR file and deploy the application.</li>
</ol>
</body>
</html>