-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Refactor HibernateException to _not_ extend RuntimeException
PostPosted: Sun Jun 26, 2005 9:14 am 
Newbie

Joined: Mon Feb 28, 2005 6:47 am
Posts: 4
Location: Norway
Hibernate version: 3.0.5

There seems to be an ongoing discussion whether having HibernateException extend RuntimeException is a good idea or not. In my organization we develop applications that are supposed to work even when a database connection goes down, and we hence cannot comply with the new guidelines of Hibernate 3.

Moreover, as we consider catching RuntimeExceptions to be Java mal-practice, we now fear that we are stuck with Hibernate 2.x.

So my question is: What would be the impact of refactoring and recompiling the Hibernate code so that HibernateException is not a subclass of RuntimeException? Does anyone with knowledge of the anatomy of Hibernate have any ideas here?

Regards,

Anders.

_________________
--
Anders


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 11:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
There seems to be an ongoing discussion whether having HibernateException extend RuntimeException is a good idea or not.


There is no ongoing discussion. There is utterly overwhelming industry consensus including everyone who does data access from Microsoft, to the EJB vendors, to the JDO vendors, to us that this is the Right Thing to do. The discussion was over more than a year ago when first Hibernate and then the EJB EG made the decision to switch.

Quote:
we hence cannot comply with the new guidelines of Hibernate 3


What new guidelines? Guidelines are the same as ever.

Quote:
we consider catching RuntimeExceptions to be Java mal-practice


Huh? You have to catch any exception somewhere. This statement makes no sense at all.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 4:50 am 
Newbie

Joined: Mon Feb 28, 2005 6:47 am
Posts: 4
Location: Norway
Thank you for your answer. I find your view on this interesting but I still utterly overwhelmingly disagree with you (and with the rest of the industry it seems). I however did not post this question to engage in a discussion I apparently will never win, I reply here because my original question stands unanswered: What would be the impact and considerations that would need my attention if I were to refactor HibernateException as suggested?

Although we disagree, I would be most thankful if you could answer this.

Cheers,

Anders

_________________
--
Anders


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 7:30 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
It is useless, but it must not be a problem to wrapp hibernate session and to rethrow all runtime exeptions as custom checked exceptions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.