This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Transactions  :confused: 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 "Transactions  :confused: " Watch "Transactions  :confused: " New topic
Author

Transactions :confused:

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
EJBException is thrown for local clients when the bean method throws a system exception.

Is my second statement true?
RemoteException is thrown for remote clients when the bean method throws a system exception.


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Is my second statement true?
RemoteException is thrown for remote clients when the bean method throws a system exception.
No, usually an EJBException is thrown to the client (regardless it's remote or local) by the container (exception: a web service client receives a java.rmi.RemoteException).

It's a good idea to study the tables in core spec 14.3 for the various cases that can encounter.


SCJP 5 (98%) - SCBCD 5 (98%)
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
No Ralph, look at page-364 of core specifications-

Throw RemoteException
to remote or web service
client; throw EJBException
to local client.
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
By "usually" I meant EJB 3 beans, of course, not EJB 2.1 beans.

To be serious, I'm glad to see that the reference for the tables helped.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Transactions :confused:
 
Similar Threads
RemoveException or EJBException
TransactionRequiredException
System exception in a BMT
System Exception Confusion
Whizlabs Exam Simulator