Re: Eclipse not display warning if try catch is not present



On Apr 5, 12:37 pm, "Oliver Wong" <o...@xxxxxxxxxxxxxx> wrote:
"Uwe Plonus" <s...@xxxxxxx> wrote in message

news:ev35tf$9v1$1@xxxxxxxxxxxx





Jason Cavett wrote:

...and...from what I've learned about RuntimeExceptions, you shouldn't
really catch them anyway. If you're getting a RuntimeException you
have a deeper problem that needs fixed.

Which is not true for HibernateException. In former versions of
hibernate it was not a RuntimeException. I don't know exactly why they
changed that but in the case of a HibernateException there are many ways
to continue.

Also other RuntimeExceptions are worth catching. Often you have the
possibility to continue.

Another thing are Errors. They are not worth of catching because you
can't do anything useful in case of an Error.

Unless, of course, the people at Hibernate decide to change
HibernateException so that it no longer subclasses (Runtime)Exception, but
Error instead. In which case, you should catch that error, as there *is*
something useful you can do with it.

In other words, forget the dogma. Catch an throwable if it makes sense
to do so, and don't catch it if it doesn't make sense to do so.

- Oliver- Hide quoted text -

- Show quoted text -

Good advice. Thanks.

.



Relevant Pages

  • Re: USB device removal while in hibernate crashes system after resume
    ... I have lots of USB devices, ... The wired apple keyboard is the ... unpug it while in hibernate. ... better advice would be: not to plug it in in the first place. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Advice on persistent storage in Java
    ... > thanks for the advice everyone. ... Beside Hibernate, there is also iBatis that has a good reputation, while ... Consulting & Services / software development ... Test XML query engine: http://jmvanel.free.fr/protea.html ...
    (comp.lang.java.databases)
  • Re: Mapping Database Tables to Objects
    ... Thanks for the advice guys. ... I had been looking into hibernate because ... seems a bit extravagant for what I need, plus, I was just flat having ... I'll take a look at Cayenne too. ...
    (comp.lang.java.programmer)
  • lost connection Between station and clustering server
    ... Some station lost access to clustering resource after it's hibernate, ... should I do, can you advice me, ...
    (microsoft.public.win2000.advanced_server)