[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3200?page=c...
]
Gino A Melone commented on HHH-3200:
------------------------------------
Arg. Somehow I submitted that while still typing. The bit of code should look like:
try {
Connection conn = connections.getConnection();
connectionMade = true;
try {
<...>
if (!useJdbcMetadata || connectionMade) {
//SQL Dialect:
Dialect dialect = determineDialect( props, databaseName, databaseMajorVersion );
settings.setDialect(dialect);
} else {
throw new HibernateException( "Unable to connect to DB, dialect can not be
determined.");
}
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira