0 Replies Latest reply on Apr 17, 2002 11:28 PM by Enrique Rodriguez

    Question about exceptions and how to manage it

    Enrique Rodriguez Newbie

      Hi all,

      i don't know how to manage the exceptions with ejbs. I see some code where in all methods of a SLSB Façade the programer cathc all exception and then throw EJBException.

      try
      {
      javax.naming.Context namingContext = new javax.naming.InitialContext ();

      _sequenceHome = (SequenceHome) namingContext.lookup ("SequenceGenerator/Sequence");//mejor local si se puede
      }
      catch(javax.naming.NamingException e)
      {
      throw new javax.ejb.EJBException (e);
      }

      In other cases, the methods throw the exception between EJBs and other tiers until the client, when the exception is catched, and some info is showed to the user.

      What is the best way to do it???

      Regards, Enrique.