[Version 5.0.2 and later]Configuring transactional deployment attributes using the Assembly Toolkit

Use this task to configure the transactional deployment descriptor attributes associated with an EJB or Web module, to enable a J2EE application to use transactions.

Why and when to perform this task

This topic describes the use of the Assembly Toolkit to configure the deployment attributes of an application. This task description assumes that you have an EAR file for an application component, that can be deployed in WebSphere Application Server. For more details about using the Assembly Toolkit, see Assembling applications with the Assembly Toolkit.

To set transactional attributes in the deployment descriptor for an application component (enterprise bean or servlet), complete the following steps:

Steps for this task

  1. Starting the Assembly Toolkit
  2. Create or edit the application EAR file.
    For example, to change attributes of an existing application, use the import wizard to import the EAR file into the Assembly Toolkit. To start the import wizard:
    1. Click File-> Import-> EAR file
    2. Click Next, then select the EAR file.
    3. Click Finish.
  3. In the J2EE Hierarchy view, right-click the component instance, then click Open With > Deployment Descriptor Editor.
    For example:
    • For a session bean, expand EJB Modules-> ejb_module_instance-> Session Beans then select the bean instance.
    • For a servlet, expand Web Modules-> web_application-> web component then select the servlet instance.
    A property dialog notebook for the component is displayed in the property pane.
  4. Set the Transaction type attribute, which defines the transactional manner in which the container invokes a method.
    You can set this attribute to Container or Bean, as follows:
    • For a session bean to use container-managed transactions, set Container
    • For a session bean to use bean-managed transactions, set Bean
    • For an entity bean, set Container
    • For a Web component (servlet), set Bean
  5. In the property pane, select the IBM Extensions tab.
  6. Under WebSphere Extensions, configure J2EE component extensions attributes for extended local transaction containment.
    To enable management of local transaction containments, configure the following EJB extensions attributes. These attributes configure, for the component, the behavior of the container's local transaction containment (LTC) environment that the container establishes whenever a global transaction is not present.
    Boundary

    This setting specifies the containment boundary at which all contained resource manager local transactions (RMLTs) must be completed. Possible values are Bean method or ActivitySession.

    • BeanMethod: This is the default value. If you select this option, RMLTs must be resolved within the same bean method in which they were started.
    • [For EJB components only] ActivitySession: RMLTs must be resolved within the scope of any ActivitySession in which they were started or, if no ActivitySession context is present, within the same bean method in which they were started.

      Note: The ActivitySession option is not supported in the web container.

    Resolver

    This setting specifies the component responsible for initiating and ending RMLTs. Possible values are Application or ContainerAtBoundary.

    • Application: This is the default value. The application is responsible for starting RMLTs and for completing them within the local transaction containment (LTC) boundary. Any RMLTs that are not completed by the end of the LTC boundary are cleaned up by the container according to the value of the Unresolved action attribute.
    • ContainerAtBoundary: The container is responsible for starting RMLTs and for completing them within the LTC boundary. The container begins an RMLT when a connection is first used within the LTC scope, and completes it automatically at the end of the LTC scope. If Boundary is set to ActivitySession, the RMLTs are enlisted as ActivitySession resources and directed to complete by the ActivitySession. If Boundary is set to BeanMethod, the RMLTs are committed at the end of the method by the container.

    Unresolved action

    Specifies the direction that the container requests RMLTs to take, if they are unresolved at the end of the LTC boundary scope and the Resolver is set to Application. Possible values are Rollback or Commit.

    • Rollback: This is the default value. At end of the LTC boundary scope, the container instructs all unresolved RMLTs to roll back.
    • Commit: At the end of the LTC boundary scope, the container instructs all unresolved RMLTs to commit. The container will instruct the RMLTs to commit only in the absence of an un-handled exception. If the application method executing under the local transaction context ends with an exception, any unresolved RMLTs are rolled back by the container. (This is the same behavior as for global transactions.)

  7. [For EJB components only] For container-managed transactions, configure how the container must manage the transaction boundaries when delegating a method invocation to an enterprise bean's business method:
    1. In the navigation pane, click the Assembly Descriptor tab.
      The Container Transactions box displays a table of the methods for enterprise beans.
    2. For each method of the enterprise bean set the Transaction attribute attribute to an appropriate value.

    If the application uses ActivitySessions, how the container manages transaction boundaries when delegating a method invocation depends on both the Transaction attribute attribute, set here, and the ActivitySession kind attribute, as described in Setting EJB module ActivitySession deployment attributes with the Assembly Toolkit. For more detail about the relationship between these two properties, see Combining transaction and ActivitySession container policies.

  8. Save your changes to the deployment descriptor.
    1. Close the deployment descriptor editor.
    2. When prompted, click Yes to indicate that you want to save changes to the deployment descriptor.
  9. Verify the archive files.
  10. Generate code for deployment for EJB modules or for enterprise applications that use EJB modules.
  11. (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. Note that Run on Server works on the Windows, Linux/Intel, and AIX operating systems only; you cannot deploy remotely from the Assembly Toolkit to a WebSphere Application Server installation on a UNIX operating system such as Solaris.

    Important: Use Run On Server for unit testing only. Assembly Server Toolkit controls the WebSphere Application Server installation and, when an application is published remotely, the Toolkit overwrites the server configuration file for that server. Do not use on production servers.

    For instructions on remote testing, see the article "Setting Up a Remote WebSphere Application Server in WebSphere Studio V5" at http://www7b.boulder.ibm.com/wsdd/techjournal/0303_yuen/yuen.html .

What to do next

After assembling your application, use a systems management tool to deploy the EAR file onto the application server that is to run the application; for example, using the administrative console as described in Deploying and managing applications.

Related tasks
Developing components to use transactions
Configuring transaction properties for an application server
Assembling applications with the Assembly Toolkit
Related reference
Using local transactions
Combining transaction and ActivitySession container policies



Searchable topic ID:   tjta_entra2
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/ae/tjta_entra2.html

Library | Support | Terms of Use | Feedback