-->
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.  [ 2 posts ] 
Author Message
 Post subject: AnnotationConfiguration does not throw exceptions
PostPosted: Tue Jul 22, 2008 9:10 am 
Newbie

Joined: Tue Jul 22, 2008 8:56 am
Posts: 3
Hi,

when an error occurs inside


Code:
sessionFactory = myConf.buildSessionFactory();


where myConf is an AnnotationConfiguration instance, the stack trace is logged (in this case it is an SQLException) but the exception is not thrown by the buildSessionFactory() method so that my application cannot react appropriately to the exception.

The question is: What do I have to do in order to get the exception thrown? Or is this a bug?

I am using Hibernate 3.2.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 10:01 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Remember, it's a RuntimeException that gets generated, so either catch Throwable or catch RuntimeException. Simply catching Exception won't work.

If it's writing to the log file, there's definitely an exception being thrown!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.