-->
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.  [ 3 posts ] 
Author Message
 Post subject: Optionally throw exception(s) collected by Schema tools
PostPosted: Fri Jul 15, 2005 2:34 am 
Beginner
Beginner

Joined: Tue Mar 15, 2005 2:36 am
Posts: 32
Location: Bonn, Germany
Hello, just want to raise this "new feature" here too, as it's related to the SchemaExport/Update tools.

Imaging those tools are triggered (executed) by some magic ... meaning persistence.xml from EJB 3.0 ... and they can't connect to the database. It's down, mis-configured or what ever. Now, those can-not-exception(s) are logged and collected and you could handle them, if you held a reference to the tool. But, here you don't. What happens is, you see those exceptions printed, your code runs and the first database access fails.

See http://forum.hibernate.org/viewtopic.php?p=2250782#2250782 for the original posting.

How can this be addressed? Perhaps a new property like:

Code:
<property name="hibernate.hbm2ddl.throwExceptions" value="true" />


Cheers,
Sormuras


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 4:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the issue is that these execeptions also could be caused by situations that should not keep your application from starting.

you could add a feature request, but im not sure if it can be done in a good way...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 5:07 am 
Beginner
Beginner

Joined: Tue Mar 15, 2005 2:36 am
Posts: 32
Location: Bonn, Germany
True - but if I could catch the throwables by myself, I could decide by the type of the exception whether the app should exit or continue.

Mhhh... as this issue only belongs to environments in which you don't have a handle to the tool (and therefore can't getExceptions() on it), I'll not file a JIRA improvement request.

Another way to achieve what I want, is executing a simple query and use the exceptions thrown there to test the database connection. Maybe that's a (the?) better solution, anyway. What do you think?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.