• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reason for removal of Checked Exceptions in Hibernate

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Why is that Hibernate or Spring has removed CheckedExceptions and made every exception as RuntimeException ,

means why they overrided basic checked exceptions like SQLException and made them to exten Runtime


Thnaks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a google for checked exceptions vs RuntimeExceptions, there are loads of resources out there where this argument is played out. Also, reading the Spring documentation will help explain (Rod Johnson is keen on the no checked exceptions technique).
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know there is a debate going on to remove CheckedExceptions , but how they will guard the program??
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can still catch the RuntimeException.

A whole new debate could be played over again, so it is best to read some of the other 'flame wars' on the topic that already exist. I guess the big thing was in the past, everyone would catch a checked exception, and then rethrow some othe checked exception. I mean, there often isn't much you can do about an SQLError, so, why force every single part of your program to have a million catch blocks, all of which just catch and rethrow the same exception. Why not just have one or two points that really make sense to do exception handling, and have them handle a runtime error.

To me, that's the basic idea.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic