]
Steve Ebersole commented on HHH-5306:
-------------------------------------
This is fixed by the introduction of services and migration of dialect resoltion to be a
service
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/#por...).
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: