Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, v1.1 - Sun Microsystems.pdf
Скачиваний:
11
Добавлен:
24.05.2014
Размер:
1.62 Mб
Скачать

Sun Microsystems Inc.

Support for Transactions

Enterprise JavaBeans v1.1, Final Release

Deployer’s responsibilities

This style is used to refer to a single method within a set of methods with an overloaded name. The method must be one defined in the remote or home interface of the specified enterprise bean. If there is also a container-transaction element that uses the Style 2 element for the method name, or the Style 1 element for the bean, the value specified by the Style 3 element takes precedence.

The optional method-intf element can be used to differentiate between methods with the same name and signature that are defined in both the remote and home interfaces.

The following is an example of the specification of the transaction attributes in the deployment descriptor. The updatePhoneNumber method of the EmployeeRecord enterprise bean is assigned the transaction attribute Mandatory; all other methods of the EmployeeRecord bean are assigned the attribute Required. All the methods of the enterprise bean AardvarkPayroll are assigned the attribute RequiresNew.

<ejb-jar>

...

<assembly-descriptor>

...

<container-transaction> <method>

<ejb-name>EmployeeRecord</ejb-name> <method-name>*</method-name>

</method> <trans-attribute>Required</trans-attribute>

</container-transaction>

<container-transaction> <method>

<ejb-name>EmployeeRecord</ejb-name> <method-name>updatePhoneNumber</method-name>

</method> <trans-attribute>Mandatory</trans-attribute>

</container-transaction>

<container-transaction> <method>

<ejb-name>AardvarkPayroll</ejb-name> <method-name>*</method-name>

</method> <trans-attribute>RequiresNew</trans-attribute>

</container-transaction> </assembly-descriptor>

</ejb-jar>

11.5 Deployer’s responsibilities

The Deployer is responsible for ensuring that the methods of the deployed enterprise beans with con- tainer-managed transaction demarcation have been assigned a transaction attribute. If the transaction attributes have not been assigned previously by the Assembler, they must be assigned by the Deployer.

11/24/99

172