Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Hibernate automatic Dialect resolution #32845

Closed
xtyuns opened this issue May 20, 2024 · 1 comment
Closed

use Hibernate automatic Dialect resolution #32845

xtyuns opened this issue May 20, 2024 · 1 comment
Labels
status: invalid An issue that we don't feel is valid

Comments

@xtyuns
Copy link

xtyuns commented May 20, 2024

SpringBoot: 3.2.5
SpringFramework: v6.1.6
Hibernate: 6.4.4


When I start the springboot application I see the warning message in the logs:

WARN --- [           main] org.hibernate.orm.deprecation            153 : HHH90000025: MySQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)

So I tried to remove the configuration entry in applicaiton.properties: spring.jpa.properties.hibernate.dialect, but the warning message still appears after restarting the application.

Then I found the reason through the debugger, this warning message is from Hibernate:
https://github.com/hibernate/hibernate-orm/blob/6.4.4/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java#L152-L154

Because there is a configuration content about hibernate.dialect here:
https://github.com/hibernate/hibernate-orm/blob/6.4.4/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java#L85-L88

It is from:

else {
Class<?> databaseDialectClass = determineDatabaseDialectClass(getDatabase());
if (databaseDialectClass != null) {
jpaProperties.put(AvailableSettings.DIALECT, databaseDialectClass.getName());
}
}

It looks like I can't use Hibernate automatic Dialect resolution and it keeps warning me about removing the default configuration.


I'm not sure if it's a good idea to remove this default detection of determineDatabaseDialectClass, and I found this: #22326

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 20, 2024
@snicoll
Copy link
Member

snicoll commented May 20, 2024

Spring Framework does not use an automatic dialect resolution unless you create the EMF yourself or use a database vendor. We can't say for sure how you end up in this situation as you haven't shared what your application is doing.

Please review the recommendation in #31889 (comment). If that doesn't help, please share a small sample we can run ourselves and we can reopen this issue.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@snicoll snicoll added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants