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

Nikita D (JIRA) noreply at atlassian.com
Fri Jun 11 10:42:58 EDT 2010


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.5.2, 3.5.1, 3.5.0-Final, 3.5.0-CR-2, 3.5.0-CR-1, 3.5.0-Beta-4, 3.5.0-Beta-3, 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2
            Reporter: Nikita D
            Priority: Minor


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