Add hibernate.jdbc.log.warnings configuration property

Description

According to the hibernate-dev mailing discussion, we need to add a new hibernate.jdbc.log.warnings configuration property that controls whether we try to fetch JDBC statement warning.

By default, this property will be false, and this way we can overcome the MySQL JDBC driver performance issue associated to getting database-generated wanings.

Environment

None

Activity

Show:
Vlad Mihalcea
January 29, 2016, 7:34 AM

That's a good point. We could move this flag into Dialect and, by default, it could be set to true. Then we set it to false in MySQLDialect, and other databases whose JDBC drivers behave like MySQL (if any). What do you think? Is this a better approach?

Andrea Boriero
January 29, 2016, 8:19 AM

Do you mean add to the Dialect a property for the default value of hibernate.jdbc.log.warnings property or to remove this setting an use just the property of the Dialect to control the logging?

Vlad Mihalcea
January 29, 2016, 8:54 AM

I wasn't aware that Oracle might handle error messages via warnings, in which case the global property becomes too restrictive.

I was thinking of handling this in the Dialect and removing the property so that most drivers can benefit from logging warn messages except for MySQL.

Andrea Boriero
January 29, 2016, 9:14 AM

I think the property gives more options, the user can decide to disable the warnings logs if not usefull for him while the Dialect default value gives us the ability to disable it for MySQL while keeping the logging the default behaviour for the other drivers.

Andrea Boriero
January 29, 2016, 1:39 PM

PR https://github.com/hibernate/hibernate-orm/pull/1252 takes the default value for hibernate.jdbc.log.warnings from the Dialect#isJdbcLogWarningsEnabledByDefault()

Fixed

Assignee

Andrea Boriero

Reporter

Vlad Mihalcea

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure