wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFEJB-497 Page- 4th qs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFEJB-497 Page- 4th qs" Watch "HFEJB-497 Page- 4th qs" New topic
Author

HFEJB-497 Page- 4th qs

vijay Mamilla
Ranch Hand

Joined: Dec 29, 2004
Posts: 94
Of the six transaction attibutes, three of them can be dangerous, with one on particular being EXTREMELY risky.Keeping in mind that Bean provider is not the one who specifies the attributs for the bean's methods, which of the six is potentially the most dangerous?

As per online ans:- Mandatory and NotSupported are dangerous, because they throw Exception.

Is NotSupported throw exception? Is this Ans is correct?
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
The transaction attributes do not throw exception by themselves. However, the container will throw an exception if it detects some unconsistent behavior. For instance, the container will throw the java.lang.IllegalStateException if either getRollbackOnly() or setRollbackOnly() are invoked from a business method executing with the Supports, NotSupported or Never transaction attributes (17.6.2.8 + 17.6.2.9). Thus, it is possible that an exception be thrown when the NotSupported attribute is specified.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
vijay Mamilla
Ranch Hand

Joined: Dec 29, 2004
Posts: 94
Thanks Valentin
Ana Nava
Greenhorn

Joined: May 25, 2004
Posts: 24
Originally posted by Valentin Crettaz:
For instance, the container will throw the java.lang.IllegalStateException if either getRollbackOnly() or setRollbackOnly() are invoked from a business method executing with the Supports, NotSupported or Never transaction attributes (17.6.2.8 + 17.6.2.9). Thus, it is possible that an exception be thrown when the NotSupported attribute is specified.


I understand that a transaction with "NotSupported" attribute can throw exception and hence can be dangerous. But I don't understand how "NotSupported" is more dangerous than "Never". In "Never" too there is possibility of having methods calls to get/setRollbackOnly() that cause an exception. Also in "Never" an Exception can be thrown if called from a transaction which is not the case in "NotSupported" as it just suspends the transaction. :roll:
[ May 17, 2005: Message edited by: ana ]
vijay Mamilla
Ranch Hand

Joined: Dec 29, 2004
Posts: 94
I agree with you.
 
jQuery in Action, 2nd edition
 
subject: HFEJB-497 Page- 4th qs
 
Similar Threads
about HFEJB page 497!!
Extremely Risky transaction attribute
HF page 500 for MDB.....
Urgent : Answer for Ques. 4 on HF page 497.....
HF EJB "Sharpen your pencil p. 497"