The following comment has been added to this issue:
Author: Andrew J Delpha
Created: Mon, 8 Dec 2003 6:59 PM
Body:
What situations would you want to ignore a problem with an update? Are there just some database drivers that throw exceptions that are harmless? (Only really worked with Oracle since I've been using Hibernate)
The type of situation I'm looking at is automated releases into a production environment, where one of the first steps is to update the database schema. If the update fails I would not want to continue the release process and would prefer not to have to parse the stdout for error messages.
Would it be acceptable to add a failOnError boolean (default to false) to the execute method (and to it's corresponding ant task).
I'm willing to write the patch for this, as I'll probably end up writing something to do this anyway.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-532
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-532
Summary: SchemaUpdate fails to throw exception when updates fail
Type: Bug
Status: Closed
Priority: Minor
Resolution: REJECTED
Project: Hibernate2
Components:
toolset
Versions:
2.0.3
Assignee:
Reporter: Andrew J Delpha
Created: Mon, 8 Dec 2003 5:26 PM
Updated: Mon, 8 Dec 2003 6:59 PM
Environment: RedHat Linux 9.1, Oracle 9i, Hibernate 2.0.3, Sun Jdk1.4.1_04
Description:
When running the schema update tool, it will fail to throw an exception if a SQLException is thrown when doing an update. It catches and logs the exception, but doesn't throw one.
In particular, in the Hibernate 2.0.3 source code, this in on line 121 of net.sf.hibernate.tool.hbm2ddl.SchemaUpdate in the execute method, in the catch inside the for loop. I believe it should also throw a hibernate exception there.
Just downloaded and looked at the 20031208 snapshot - it appears that the SchemaUpdate tool there also only logs the exceptions. Is this intentional?
I believe it is desirable to have the SchemaUpdate fail if there's a problem for scripting automated builds and such.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|