Configure application managed tasks for Enterprise JavaBeans

 

Overview

Configure an EJB application managed tasks to associate requests from the bean with application profiles. This task should be performed only for enterprise Java beans that programmatically set the configured task and then programmatically begin either a transaction or ActivitySession. If a unit of work is not begun after the task is set, then the set task is ignored. The task should never be performed for an Enterprise Bean which uses container-managed transactions or container-managed ActivitySessions.

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 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. We can do this by specifying the -CCDappprofileCompatibility=true option when invoking the launchClient command.

 

Procedure

  1. Start the Application Server Toolkit.

  2. Optional: Open the J2EE perspective to work with J2EE projects. Click Window > Open Perspective > Other > J2EE.

  3. Optional: Open the Project Explorer view. Click Window > Show View > Project Explorer. Another helpful view is the Navigator view (Window > Show View > Navigator) .

  4. 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:

    1. Select File > Import > EAR file > Next

    2. Select the EAR file.

    3. Create a WAS v6.0 type of Server Runtime. Select New to open the New Server Runtime Wizard and follow the instructions.

    4. In the Target server field, select WebSphere Application Server v6.0 type of Server Runtime.

    5. Select Finish

  5. 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.

  6. Select the Extended Access tab.

  7. Beneath the Application-Managed Tasks table, select Add....

  8. Select the bean for which you want to configure the task.

  9. Type the name of the task reference. The task reference name is used programmatically by the bean. The task reference is the logical representation of the task used by the run time environment.

  10. 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 run time environment.

  11. Select OK.


 

See Also


Application profiling tasks

 

Related Tasks


Using the TaskNameManager interface
Creating an application profile