Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Exception ques. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Exception ques." Watch "Exception ques." New topic
Author

Exception ques.

Tontang Bei
Ranch Hand

Joined: Oct 21, 2006
Posts: 130
What will happen if I call getRollbackOnly() or SetRollbackOnly() of EJBContext in methods not marked with Required, RequiresNew or Mandatory? will I get an exception?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Why would you get an exception ? You would have a transaction and CMT and you can setrollbackonly from the context. Its legal. If you use the userTransaction however, thats another question.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Malan Subramanian
Greenhorn

Joined: Jul 09, 2005
Posts: 13
Hmm... Assuming that am calling setRollbackOnly() in a CMT bean whose business method has a transaction attribute, NotSupported or Never, then an exception should definitely be thrown coz there is no active transaction available for rollback.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception ques.
 
Similar Threads
Struts application design question
WA #1.....word association
what is error?
void return type in JSP expression
Server Exception