I don't want to get involved in a programming practice debate BUT......

The performance hit from exceptions occur because exceptions are thrown, not
in how they are handled. You cannot programatically avoid exceptions with
xhaustive checking that would itself hinder performance. Specifically
potential SQL errors are <pun>exceptionally</pun> difficult to cater for.
(dropped connections, network problems, constraint violations) .Exceptions
are only thrown when something goes wrong. The point I was trying to make
was that exceptions are not only a sign of system failure, but one of usage
failure too.

Anyway, what I was trying to do was to implement a transaction & logging
filter that determined if a particular database write operation had worked.
The code is simple and checks if a servlet/jsp has thrown an exception to
check for success/failure. If the servlet/jsp completes without throwing an
exception, I commit the transaction, otherwise I roll it back.

Is there some recognised way to pass servet/jsp error conditions to filters?
This would prevent me relying on exceptions (altho' exceptions would have to
be catered for too). I suppose I could use the request.getAttribte()?

Are exceptions that are trapped in a filter 'seen' and handled by Tomcat?

TIA

- Mark

> I'll second what Craig has said and add that if your program "normally"
> throws lots of exceptions, then you should look at some of your design
> decisions. Exceptions are wonderful when used for "Exceptional" behavior,
> but not for "normal" runs. They are also REALLY slow. Exceptions can kill
> your performance, and if you are getting them regularly, you should catch
> the ones you can "safely" ignore as early as possible and toss them away
as
> appropriate, or even better, not throw them at all.
>
> Regards,
>
> Will Hartung
> ([EMAIL PROTECTED])
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to