[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-5306) Dialect resolution: Cannot set a custom dialect resolver programatically or using hibernate.cfg.xml

Steve Ebersole (JIRA) noreply at atlassian.com
Fri Mar 4 17:03:08 EST 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-5306.
-------------------------------

    Resolution: Fixed

> Dialect resolution: Cannot set a custom dialect resolver programatically or using hibernate.cfg.xml
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5306
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5306
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2, 3.5.0.Beta-1
>            Reporter: Nikita D
>            Assignee: Steve Ebersole
>            Priority: Minor
>             Fix For: 4.0.0.Alpha1
>
>
> Starting with version 3.3, Hibernate introduced an extremely useful dialect resolution feature (http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#portability-dialectresolver). The problem is with the configuration of a custom dialect resolver:
>  * Setting the property Environment.DIALECT_RESOLVERS in the Configuration of a SessionFactory doesn't work, because DialectFactory only reads from Environment.getProperties(), which is only the global properties (system properties plus the hibernate.properties file).
>  * Setting a system property programatically is not safe, because the Environment class caches the system properties in a static constant, so if it's loaded before the code that sets the system property, the property will not be picked up.
>  * The registerDialectResolver() method on DialectFactory is not public.
> Ideally, it should be possible to configure a custom dialect resolver by setting the property Environment.DIALECT_RESOLVERS on a Configuration object, just as one would configure an explicit dialect. Alternatively, I think an acceptable "quick fix" would be to expose the registerDialectResolver() method on DialectFactory.

-- 
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