Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Container-Transaction tag ???

 
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>
 
Ranch Hand
Posts: 245
 
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?
 
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
Boost this thread!