• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Container-Transaction tag ???

 
Deep Chand
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MZ Study Notes say: It is required that all the methods specified in a single container-transaction element be methods of the SAME enterprise bean. However, HF (Page 504) shows an example of Container-Managed transaction tag where multiple methods of multiple beans are shown in it. Please reply which is correct.

Something like:

<container-transaction>
<method>
<ejb-name>BeanA</ejb-name>
<method-name>MethodA</method-name>
</method>
<method>
<ejb-name>BeanA</ejb-name>
<method-name>MethodB</method-name>
</method>
<method>
<ejb-name>BeanXYZ</ejb-name>
<method-name>MethodXYZ</method-name>
</method>
</container-transaction>
 
Gemini Moses
Ranch Hand
Posts: 245
 
k space
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB 2.0 spec - 17.4.1 Transaction attributes did say:

The Application Assembler uses the container-transaction elements to define the transaction attributes for the methods of session and entity bean home and component interfaces and for the onMessage methods of message-driven beans. Each container-transaction element consists of a list of one or more method elements, and the trans-attribute element. The container-transaction element specifies that all the listed methods are assigned the specified transaction attribute value. It is required that all the methods specified in a single container-transaction element be methods of the same enterprise bean.
 
Deep Chand
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So that means, this is a mistake in HF. Correct?
 
Stefan Guilhen
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. I corrected my post in the other thread. I just wonder why this is not true regarding the method-permission element. I checked the section 21.3.2 of the spec (Application Assembler responsibilities) regarding the method-permission and it does not say that all the methods must be from the same bean, althought the example shown in page 445 shows this arrangement - notice the role employee appearing in two method-permission elements. Any ideas?

Regards,
Stefan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic