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

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


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29875 ] 

Gino A Melone commented on HHH-3200:
------------------------------------

The pertinent logs:
[3/25/08 11:25:33:750 EDT] 00000020 SystemOut     O  WARN hibernate.cfg.SettingsFactory 2008-03-25 11:25:33,750 - Could not obtain connection metadata
java.sql.SQLException: [IBM][SQLServer JDBC Driver][IBM][SQLServer JDBC Driver]The requested instance is either invalid or not running.DSRA0010E: SQL State = 08001, Error Code = 0
<...>
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
<...>

<...>
Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
	at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
	at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
	at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
<...>


> 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.5, 3.2.6
>         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