This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes ejb-jar.xml question. Please clarify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejb-jar.xml question. Please clarify" Watch "ejb-jar.xml question. Please clarify" New topic
Author

ejb-jar.xml question. Please clarify

nalini kumari
Greenhorn

Joined: Apr 15, 2008
Posts: 2
<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

Joined: May 26, 2003
Posts: 30894
    
158

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.)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
nalini kumari
Greenhorn

Joined: Apr 15, 2008
Posts: 2
Thanks for clarifying.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb-jar.xml question. Please clarify