I never intentionally code a:

    throws RemoteException();

statement in my code. From a design standpoint, I think the best approaches in order of desirability will be:

1. throw ApplicationSpecificException();
2. throw FinderException(), ObjectNotFoundException(), CreateException(), etc.
3. throw EJBException();

I often throw EJBExceptions when I trap a SQLException.

jim

To: [EMAIL PROTECTED]
cc:
Subject: [jBoss-User] Throwing RemoteException in EJB Impl.



EJB 1.1 spec ( 12.3.7 ) says
" .. the java.rmi.RemoteException is deprecated in EJB 1.1�enterprise beans
written
for the EJB 1.1 specification should use the javax.ejb.EJBException instead."

If I have a business method that communicates with another EJB I must
handle RemoteException.
Should I catch RemoteException and throw a new EJBException ?

public businessMethod() {
         try {
                 // Call other EJB
         } catch (java.rmi.RemoteException re) {
             throw new EJBException(re);
         }
}

/Roland



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]

Reply via email to