A drawback of approach 'b' is that the container in response to a runtime
exception will discard your session bean instance. This will happen even
when the session bean might have been prefectly ok and an application
exception that it encountered while communicating with entity beans would in
no way have caused the session bean to be unsuitable for future use.

Wrapping expected EJB application exceptions in the SLSB and throwing them
as runtime will hence cause a performance overhead.

----- Original Message -----
From: "Chandrasekar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 21, 2002 5:55 PM
Subject: Re: what to do with exceptions


> We throw a CustomException and catch it in the webtier.This
> is then forwarded to a Error jsp page which takes the
> error message(user friendly) and the possible
> reasons(From Property File for each type of Exception) and
> displays it on the page.
>
>
> Chandra
>
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Dmitri Colebatch
> Sent: Thursday, March 21, 2002 11:58 AM
> To: [EMAIL PROTECTED]
> Subject: what to do with exceptions
>
>
> hey everyone,
>
> something thats been in the back of my head for a while.
>
> what do ppl do with the various exceptions thrown in EJB?  Specifically,
in
> the web tier.  typical scenario, some code in the web
> tier needs to create a SLSB, and invoke a method on it.  In the SLSB, the
> invoking of that method has to deal with another 3-4 EJB
> exceptions.  So, do you
>
>   a) catch them, and rethrow them as your own custom exception type
>   b) catch them, and rethrow them as a runtime exception
>   c) just add them to the throws clause
>
> and then in the web tier, do you handle these exceptions each
individually,
> or do you just let the 500 error page pick them up
> (assuming you have a nice one).
>
> I'm always inclined to do (b), as the only time I ever see them is in
> development when I've made an error... its unlikely I'm going
> to be able to deal with them gracefully anyway, so it seems logical -
> however, at the same time I've got the voice in the back of my
> head telling me I'm being lazy...
>
> be interested to hear other ppl's thoughts on this.
>
> cheers
> dim
>
>
===========================================================================
> 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".
>
>
===========================================================================
> 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".
>

===========================================================================
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