Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Remko Strating wrote:I personally don't know what to think. Normal SQL-statements throw a checked exception and JPA not, but a JPA exception shouldn't be a real system exception the user could enter wrong data which can be corrected afterwards. Maybe it's in the filosofie of JPA that this exceptions are checked before using JPA for updating and inserting by using the listener classes. But then you have also to throw a runtime exception.
Remko Strating wrote:
The frustration of catching al kind of exception is also familiar for me. I try to catch them nicely, but time pressures make me sometimes just to use catch (Exception ex) en then log it and shows an error to the user. Mostly you don't do something else with it.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Kengkaj Sathianpantarit wrote:For me, this might be sort of an admission from Sun that using checked exception is not so good .
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Reza Rahman wrote:
I believe the primary driver here for JPA 1.0 was the Hibernate folks not using checked exceptions and believing strongly that they should not be used in JPA either.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Reza Rahman wrote:I think you missed the point - there isn't much value in arguing about what a particular API/product/language does or does not do.
Reza Rahman wrote:
I would certainly like to hear reasoning of where anyone might disagree with what is outlined about valid cases for checked exceptions as outlined by the article I posted (widely used as a Java best practice, including in Java SE/EE) or some of the specific reasons I have already cited (type safety, clear API contract, documentation, etc).
Reza Rahman wrote:
I don't see a problem with well-applied checked exceptions. I have personally seen them well applied in many enterprise Java solutions. I have also seen many failings for unchecked exceptions/errors in Java and elsewhere (some of which I have already mentioned as well).
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Reza Rahman wrote:
Yet again, I am a little surprised as to why you are not thoroughly cognizant of these things already. The SCJP should have covered this? The Sun Java Tutorial certainly does: http://java.sun.com/docs/books/tutorial/essential/exceptions/runtime.html. The title of this resource is "Unchecked Exceptions — The Controversy". I think the Sun best practices statement provides a very clear guideline and justification for the guideline.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |