[Version 5.0.2]Setting EJB module ActivitySession deployment attributes with the Application Assembly Tool

Use this task to set the ActivitySession deployment attributes for an enterprise bean to enable the bean to participate in an ActivitySession context and support ActivitySession-based operations.

Why and when to perform this task

You can configure the deployment attributes of an application by using the Deployment Descriptor Editor of WebSphere Studio Application Developer or the Application Assembly Tool.

To set the ActivitySession deployment attributes for an enterprise bean, use the Application Assembly Tool to complete the following steps:

Steps for this task

  1. Launch the Application Assembly Tool.
  2. Create or edit the application EAR file.
    For example, to change attributes of an existing application, click File-> Open then select the EAR file.
  3. In the navigation pane, select the enterprise bean instance; for example, for an entity bean expand ejb_module_instance-> Entity beans then select the bean instance.
    A property dialog notebook for the enterprise bean is displayed in the property pane.
  4. In the property pane, select the IBM Extensions tab.
  5. In the Bean Cache group box, set the Activate at attribute to Activity Session:

    An enterprise bean with this activation policy is activated and passivated as follows:

    • On an ActivitySession boundary, if an ActivitySession context is present on activation.
    • On a transaction boundary, if a transaction context, but no ActivitySession context, is present on activation.
    • Otherwise on an invocation boundary.

  6. In the Local Transactions group box, set the Boundary attribute to ActivitySession:
    When this setting is used, the local transaction must be resolved within the scope of any ActivitySession in which it was started or, if no ActivitySession context is present, within the same bean method in which it was started.
  7. For entity beans, or session beans, set the ActivitySessions properties for each EJB method.
    1. In the navigation pane, select Container ActivitySessions.
      This displays a table of the methods for enterprise beans.
    2. For each method of the enterprise bean set the ActivitySession kind attribute to specify how the container must manage the ActivitySession boundaries when delegating a method invocation to an enterprise bean's business method:
      Supports
      If the client invokes the bean method within an ActivitySession, the container invokes the bean method within an ActivitySession context. If the client invokes the bean method without a ActivitySession context, the container invokes the bean method without an ActivitySession context. The ActivitySession context is passed to any enterprise bean objects or resources that are used by this bean method.
      Not supported
      The container invokes bean methods without an ActivitySession context. If a client invokes a bean method from within an ActivitySession context, the container suspends the association between the ActivitySession and the current thread before invoking the method on the enterprise bean instance. The container then resumes the suspended association when the method invocation returns. The suspended ActivitySession context is not passed to any enterprise bean objects or resources that are used by this bean method.
      Never
      The container invokes bean methods without an ActivitySession context.
      • If the client invokes a bean method from within an ActivitySession context, the container throws an InvalidActivityException exception, which is a javax.rmi.RemoteException.
      • If the client invokes a bean method from outside an ActivitySession context, the container behaves in the same way as if the Not Supported value was set. The client must call the method without an ActivitySession context.
      Required
      The container invokes the bean method within an ActivitySession context. If a client invokes a bean method from within an ActivitySession context, the container invokes the bean method within the client ActivitySession context. If a client invokes a bean method outside an ActivitySession context, the container creates a new ActivitySession context and invokes the bean method from within that context. The ActivitySession context is passed to any enterprise bean objects or resources that are used by this bean method.
      Requires new
      The container always invokes the bean method within a new ActivitySession context, regardless of whether the client invokes the method within or outside an ActivitySession context. The new ActivitySession context is passed to any enterprise bean objects or resources that are used by this bean method.

      Any received ActivitySession context is suspended for the duration of the method and resumed after the method ends. The container starts a new ActivitySession before method dispatch and completes it after the method ends.

      Mandatory
      The container always invokes the bean method within the ActivitySession context associated with the client. If the client attempts to invoke the bean method without an ActivitySession context, the container throws an ActivityRequiredException exception to the client. The ActivitySession context is passed to any EJB object or resource accessed by an enterprise bean method.

      The ActivityRequiredException exception is javax.rmi.RemoteException.

    How the container manages the ActivitySession boundaries when delegating a method invocation depends on both the ActivitySession kind attribute, set here, and the Transaction attribute attribute, as described inConfiguring transactional deployment attributes using the Application Assembly Tool. For more detail about the relationship between these two properties, see Combining transaction and ActivitySession container policies.

  8. To apply the changes and close the Application Assembly Tool, click OK. Otherwise, to apply the values but keep the property dialog open for additional edits, click Apply.
  9. To see changes reflected in your application, regenerate deployment code and reinstall the deployable archive.

Related concepts
The ActivitySession service
Related tasks
Using the ActivitySession service
Related reference
Combining transaction and ActivitySession container policies
Container ActivitySession assembly properties for EJB modules



Searchable topic ID:   tas_depejb
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/ass/tasks/tas_depejb.html

Library | Support | Terms of Use | Feedback