[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-1042) Make DocHelper robust against failing buildSettings()

Arnout Engelen (JIRA) noreply at atlassian.com
Mon Mar 3 17:55:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-1042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29651 ] 

Arnout Engelen commented on HBX-1042:
-------------------------------------

Indeed, all the relevant information (default schema, default catalog and dialect) is readily present in the Properties of the Configuration.

However, DocHelper still insists on calling cfg.buildSettings() to get the information from there - as far as I can see it is not used for anything else.

Couldn't we make DocHelper simply use the information from the Properties, instead of calling cfg.buildSettings()? Or, alternatively, issue a warning and take the settings from the Properties in case calling buildSettings() fails?

I'd be happy to provide a patch for either solution.

> Make DocHelper robust against failing buildSettings()
> -----------------------------------------------------
>
>                 Key: HBX-1042
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1042
>             Project: Hibernate Tools
>          Issue Type: Improvement
>          Components: hbm2doc
>            Reporter: Arnout Engelen
>         Attachments: dochelper.diff.txt
>
>
> DocHelper calls cfg.buildSettings(). to get the Dialect, default catalog name and default schema name.
> However, cfg.buildSettings() may fail with a HibernateException (example below). 
> It would be nice to have DocHelper handle this more gracefully. Attached is a simple patch that does this.
> (background: I'd like to use the Configuration I'm getting from a Spring LocalSessionFactoryBean, which after initial creation leaves its LocalDataSourceConnectionProvider in a state that yiels a HibernateException when calling 'configure()' on it, which buildSettings() does. Because of this issue, I cannot use the DocExporter for my Spring-based hibernate configurations)

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list