Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

exception handling when invoke ejb

843829May 11 2004 — edited May 14 2004
Hi,
I call ejb like this:
try {
      MyBeanHome beanHome = .. //jndi lookup  
      MyBean bean = beanHome .create();
      HashMap h = bean.chargeFee(data);
      bean.remove();
} catch (
....
}
there are a lot exceptions: NamingException, CreationException, RemoteException, RemoveException (I don't have application exception).
I am thinking I catch the RemoveException first, since it happened after the chargeFee is called, and chargeFee is already been executed, so I deal it differently with the other Exceptions, since they heppend before or during the chargeFee executed, I treat it as not been executed.

Is it the right way to handle the exceptions? Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2004
Added on May 11 2004
3 comments
153 views