[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6633) SchemaExport tool swallows interesting exceptions whilst reporting on irrelevant exceptions
Ben Hood (JIRA)
noreply at atlassian.com
Mon Sep 5 14:57:02 EDT 2011
SchemaExport tool swallows interesting exceptions whilst reporting on irrelevant exceptions
-------------------------------------------------------------------------------------------
Key: HHH-6633
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6633
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.5
Environment: 3.6.5 Oracle 11g
Reporter: Ben Hood
I don't think the API of the SchemaExport tool is quite right. When using it to create a fresh DDL, the SQL errors that result from the (irrelevant) DROP statements are collected in a list member of the SchemaExport instance. These errors are skipped over, because they usually occur when you have a fresh database, but their occurrence is recorded. This is uncool because when you set the haltOnError flag, as soon as it hits an error that you do actually care about, e.g. can't create a table for some reason, a JDBCException is raised. However, this exception is caught by higher level code, and hence the invoker does not get notified of that error. To make matters worse, you can't then introspect the collected errors, it is just full of the SQLExceptions generated by the DROP statements, but there is nothing to demarcate them as such. You are left with a situation where you don't really know if an error has occurred that you should care about.
If you would like a patch to correct this behavior, I would be happy to supply one.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list