Operating Systems: i5/OS
Personalize the table of contents and search results
Configure container-managed tasks for Enterprise JavaBeans
For methods that cause a new transaction or ActivitySession to
be started either by the container or programmatically by the Enterprise JavaBean
(EJB) developer, you can configure an enterprise bean's container-managed
tasks to associate requests from the bean with application profiles.
Overview
Units of work begun during the execution of a method configured
with a task are associated with the task name. If the method is executed under
an imported transaction, then the configured task is ignored. For more information
about using tasks, see Application profiling tasks and Tasks and units of work considerations.
Note: If you select the 5.x Compatibility
Mode attribute on the Application Profile Service's console page, then tasks
configured on J2EE 1.3 applications are not necessarily associated with units
of work and can arbitrarily be applied and overridden. This is not a recommended
mode of operation and can lead to unexpected deadlocks during database access.
Tasks are not communicated on requests between applications that are running
under the Application Profiling 5.x Compatibility Mode and applications that
are not running under the compatibility mode.
For a V6.0 client
to interact with applications run under the Application Profiling 5.x Compatibility
Mode, set the appprofileCompatibility system property to true in
the client process. You can do this by specifying the -CCDappprofileCompatibility=true option
when invoking the launchClient command.
Procedure
- Start the Application Server Toolkit.
- Optional: Open the J2EE perspective to work with J2EE
projects. Click Window > Open Perspective > Other > J2EE.
- Optional: Open the Project Explorer view. Click Window
> Show View > Project Explorer. Another helpful view is the Navigator
view (Window > Show View > Navigator) .
- Create a new application EAR file or edit an existing one.
For example, to change attributes of an existing application, use
the import wizard to import an EAR file. To start the import wizard:
- Select File > Import > EAR file > Next
- Select the EAR file.
- Create a WebSphere Application Server v6.0 type
of Server Runtime. Select New to open the New Server Runtime Wizard
and follow the instructions.
- In the Target server field, select WebSphere Application Server
v6.0 type of Server Runtime.
- Select Finish
- In the Project Explorer view of the J2EE perspective, right-click
the Deployment Descriptor: EJB Module Name under the EJB module for
the bean instance, then select Open With > Deployment Descriptor Editor.
A property dialog notebook for the EJB project is displayed in the property
pane.
- Select the Extended Access tab.
- Beneath the Container-Managed Tasks table, select Add....
- Select the bean for which you want to configure the task.
- Select Next.
- Select the method for which you want to configure the task.
. This method must begin a new unit of work in order for the configured
task to be applied. If the method runs under an imported unit of work, then
the configured task on the method is ignored. If the container begins a new
unit of work when the method executes, then it is associated with the configured
task name. If the method's implementation programmatically begins a new unit
of work, then that unit of work is associated with the configured task name.
- Select Next.
- Enter the name and description of the task.
The task name is mapped to application profiles and used by the run
time to determine the appropriate access intent to use for enlisted entities.
Task names do not have to be unique within an application. However, task names
should be shared consciously and conservatively. At run time, all tasks with
the same name are treated the same way, regardless of where you configured
the task.
The description is provided for your convenience; it is not used
by the runtime environment.
- Select OK.
}
Application profiling tasks
Related tasks
Automatically configuring application profiles and tasks
Creating an application profile
|