Set transactional attributes in the deployment descriptor
To set transactional attributes in the deployment descriptor for an application component (enterprise bean or servlet), complete the following steps:
- Start the Application Assembly Tool.
- Create or edit the application EAR file. For example, to change attributes of an existing application, click File-> Open then select the EAR file.
- In the navigation pane, select the component instance; for example:
- For a session bean, expand ejb_module_instance-> Session beans then select the bean instance.
- For a servlet, expand web_application-> Web Components then select the servlet instance.
A property dialog notebook for the component is displayed in the property pane.
- In the property pane, select the Advanced tab.
- Set the Transaction type attribute, which defines the transactional manner in which the container invokes a method. One 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
- In the property pane, select the IBM Extensions tab.
- 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 behaviour of the container's local transaction containment (LTC) environment that the container establishes whenever a global transaction is not present.
Boundary
- Specifies the duration of a local transaction context. One can set this attribute to Bean method or ActivitySession, as described in Entity bean assembly settings.
The ActivitySession option is not supported in the web container.
This property can be changed on WAS Enterprise only.
Resolution control
- Specifies how the local transaction is to be resolved before the local transaction context ends: by the application through user code or by the EJB container. One can set this attribute to either Application or ContainerAtBoundary, as described in Entity bean assembly settings.
Unresolved action
- Specifies the action that the container must take when the local transaction context scope ends, if resources are uncommitted by an application in a local transaction and the Resolution control is set to Application. One can set this attribute to either Commit or Rollback, as described in Entity bean assembly settings.
- [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:
- In the navigation pane, select Container Transactions. This displays a table of the methods for enterprise beans.
- For each method of the enterprise bean set the Transaction attribute attribute to an appropriate value, as defined in Container transaction assembly settings.
See also:
- Developing components to use transactions
- Configure transaction properties for an appserver
- Using local transactions
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.