Operating Systems: i5/OS
Personalize the table of contents and search results
Set Web module ActivitySession deployment attributes
Use this task to set the ActivitySession deployment attributes
for a Web application to start UserActivitySessions and perform work scoped
within ActivitySessions.
This task assumes that you have an Enterprise Archive (EAR) file that
contains an application enterprise bean that can be deployed in WebSphere
Application Server. For more details about assembling applications, see Assembling applications.
Overview
You can configure the deployment attributes of an application
by using an assembly
tool. This topic describes the use of the Application Server Toolkit
(AST) to configure the deployment attributes.
To set the ActivitySession
deployment attributes for a Web application, complete the following steps:
Procedure
- Start the assembly tool. For more information about
starting the AST, refer to the Application Server Toolkit information in the
navigation pane of this infocenter.
- Create or edit the Web module. For example, to change
attributes of an existing module, click File-> Open then select the
archive file for the module. For example, to change attributes
of an existing module, use the import wizard to import the EAR or WAR file
into the assembly tool. To start the import wizard:
- Click File-> Import-> WAR file
- Click Next, then select the WAR file.
- Click Finish
- In the J2EE Hierarchy view, right-click the Web module, then click Open
With > Deployment Descriptor Editor. A property dialog
notebook for the Web module is displayed in the property pane.
- In the property pane, select the Extended services tab.
- Select the servlet that you want to change.
- In the ActivitySession section, set the ActivitySession control
kind attribute to either Application, Container, or None.
- Application
-
The Web application is responsible for starting and ending ActivitySessions,
as follows:
- If an HttpSession is active when an application begins an ActivitySession,
then the container associates the ActivitySession with the HttpSession.
- If an ActivitySession is started in the absence of an HttpSession, then
the application must ensure it is completed before the dispatched method completes;
otherwise, an exception results.
- If an HttpSession is associated with a request dispatched to an application
with this ActivitySession control value, and if that HttpSession has an ActivitySession
associated with it, then the container dispatches the request in the context
of that ActivitySession. For example, the container resumes the ActivitySession
context onto the thread before the dispatch.
- A Web application can use both transactions and ActivitySessions. Any
transactions started within the scope of an ActivitySession must be ended
by the web component that started them and within the same request dispatch.
- Container
-
A servlet has no access to UserActivitySessions. Any HttpSession started
by the servlet has an ActivitySession automatically associated with it by
the container, and this ActivitySession is put onto the thread of execution.
If such a servlet is dispatched by a request that has an HttpSession containing
no ActivitySession, then the container starts an ActivitySession and associates
it with the HttpSession and the thread.
A Web application can use both transactions
and ActivitySessions. Any transactions started within the scope of an ActivitySession
must be ended by the web component that started them and within the same request
dispatch.
- None
-
A servlet has no access to UserActivitySession. An HttpSession started
by the servlet does not have an ActivitySession automatically associated with
it by the container. If such a servlet is dispatched by a request that has
an HttpSession containing an ActivitySession, then the container dispatches
the request in the context of that ActivitySession. For example, the container
resumes the ActivitySession context onto the thread before the dispatch.
- To apply the changes and close the assembly tool, click OK.
Otherwise, to apply the values but keep the property dialog open for additional
edits, click Apply.
- Save your changes to the deployment descriptor.
- Close the deployment descriptor editor.
- When prompted, click Yes to indicate
that you want to save changes to the deployment descriptor.
- Verify the archive files. For more information about
verifying files using the AST, refer to the Application Server Toolkit information
in the navigation pane of this infocenter.
- From the popup menu of the project, click Deploy to
generate EJB deployment code.
- Optional: Test your completed module on a WebSphere
Application Server installation. Right-click a module, click Run on Server,
and follow the instructions in the displayed wizard.
Use Run
On Server for unit testing only. The assembly tool controls the WebSphere
Application Server installation and, when an application is published remotely,
the assembly tool overwrites the server configuration file for that server.
Do not use on production servers.
What to do next
After assembling your application, use a systems management tool
to deploy the WAR file; for example, using the administrative console as described
in Deploying and managing
applications.
}
Related concepts
The ActivitySession service
Related tasks
Using the ActivitySession service
|