I am invoking a method from bean A on bean B.  My method invocation looks
like this:

class A ... {
  void foo() throws RemoteException {
    try {
      b.method();
    }
    catch (RemoteException e) {
      throw e;
    }
    catch (EJBException e) {
      throw e;
    }
    catch (Exception e) {
      throw new EJBException(e);
    }
  }
}

Is this the proper sequence of exception handling?  It seems too much work
to just invoke a method on a bean.  Should I replace the code with something
like:

class A ... {
  void foo() throws RemoteException {
    try {
      b.method();
    }
    catch (Exception e) {
      throw new EJBException(e);
    }
  }
}

But then the RemoteException would be wrapped in EJBException hiding the
real RemoteException.  Also, any EJBExceptions thrown, will be  "double"
wrapped in another EJBException.  If the goal of EJB is to deliver
exceptions to the client exactly as they are thrown, this would defeat that
purpose.

Any comments?

Thanks.
-AP_

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to