[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3200) Dialect auto-detection provides misleading error message

Gino A Melone (JIRA) noreply at atlassian.com
Tue Mar 25 11:51:32 EDT 2008


Dialect auto-detection provides misleading error message
--------------------------------------------------------

                 Key: HHH-3200
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3200
             Project: Hibernate3
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.6, 3.2.5
         Environment: I'm testing with 3.2.5.ga, Windows XP SP2, and SQL Server 2000.  However, I'm fairly certain this will affect any OS/DB combination.
            Reporter: Gino A Melone


If the DB connection is unable to be created in org.hibernate.cfg.SettingsFactory.buildSettings(Properties props), the error message that is returned indicates "Hibernate Dialect must be explicitly set".  This message is misleading.  The real problem is that auto-detection can not work because the DB connection failed and the metadata could not be retrieved.  A warning is issued that explains this, but production environments often disable log4j warnings for third-party packages to maintain reasonable-sized log files.

The failure to create a connection should be used to generate a useful error message.  Something like:

		//SQL Dialect:
		Dialect dialect = determineDialect( props, databaseName, databaseMajorVersion );
		settings.setDialect(dialect);


The relevant log entries are below.

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