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

Sun Microsystems Inc.

Support for Transactions

Enterprise JavaBeans 2.0, Public Draft

Container Provider responsibilities

16.7.3.5 Handling of getUserTransaction() method

If an instance of a message-driven bean with container-managed transaction demarcation attempts to invoke the getUserTransaction() method of the EJBContext interface, the Container must throw and log the java.lang.IllegalStateException.

16.7.4 Local transaction optimization

The container may perform the optimization for enterprise beans whose deployment descriptor indicates that this optimization is permitted.

The container may use the optimization for transactions initiated by the container for a bean with container managed transaction demarcation and for transactions initiated by a bean with bean managed transaction demarcation with the UserTransaction interface. The container cannot apply the optimization for a bean with container managed transaction demarcation if the client invokes the bean with a transaction context and the bean method has the Required or Mandatory transaction attribute.

The container should use the javax.resource.LocalTransaction [ 11 ] interface instead of the XAResource interface to manage transactions on the resouce manager connection if the resource adaptor supports it. Otherwise, the container may use the resource-adaptor specific APIs for local transaction management.

The container is required to arrange the sharing of a single physical resource manager connection by all the enterprise beans in the group. Refer to [ 11 ] for further discussion.

16.7.5 Handling of methods that run with “an unspecified transaction context”

The term “an unspecified transaction context” is used in the EJB specification to refer to the cases in which the EJB architecture does not fully define the transaction semantics of an enterprise bean method execution.

This includes the following cases:

The execution of a method of an enterprise bean with container-managed transaction demarca-

tion for which the value of the transaction attribute is NotSupported, Never, or Supports[24].

The execution of the ejbCreate<METHOD>, ejbRemove, ejbPassivate, and ejbActivate methods of a session bean with container-managed transaction demarcation.

The execution of the ejbCreate<METHOD> and ejbRemove methods of a message-driven bean with container-managed transaction demarcation.

[24]For the Supports attribute, the handling described in this section applies only to the case when the client calls without a transaction context.

5/31/00

334