Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb-jar.xml question. Please clarify

 
nalini kumari
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<ejb-jar>
<display-name>MyEJB</display-name>
<enterprise-beans>
<session>
<ejb-name>MyEJB</ejb-name>
<home>MyEJBHome</home>
<remote>MyEJBRemote</remote>
<ejb-class>MyEJBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MyEJB</ejb-name>
<method-name>Method1</method-name>
</method>
<trans-attribute>Mandatory</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>MassmodsDA</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Never</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


Suppose this is my deployment descriptor.
What is transaction attribute associated to my method "Method1".

Is this "Mandatory" or "Never"? Does direct declaration of the method overwrites "*" declaration?

Please clarify.
Thanks.
[ April 15, 2008: Message edited by: nalini kumari ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by nalini kumari:
Does direct declaration of the method overwrites "*" declaration?

Yes. The "*" only applies to methods you haven't specified directly when everything is in the deployment descriptor. (I recall the rule being more involved when some transaction settings are annotated in EJB 3 JPA beans.)
 
nalini kumari
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clarifying.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic