Skip to content

Commit

Permalink
Re-enable detection of the database version by default when using exp…
Browse files Browse the repository at this point in the history
…licit Hibernate ORM dialects

Because that detection is now done by the Hibernate ORM dialect itself,
and should work properly for all dialects.
  • Loading branch information
yrodiere committed Oct 8, 2024
1 parent 7db347e commit f22e634
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 186 deletions.
6 changes: 0 additions & 6 deletions docs/src/main/asciidoc/hibernate-orm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ Hibernate ORM may generate SQL that is invalid which would lead to runtime excep
If the database cannot be reached, a warning will be logged but startup will proceed.
You can optionally disable the version check if you know the database won't be reachable on startup
using <<quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check,`quarkus.hibernate-orm.database.version-check.enabled=false`>>.
// TODO change the default to "always enabled" when we solve version detection problems
// See https://github.com/quarkusio/quarkus/issues/43703
// See https://github.com/quarkusio/quarkus/issues/42255
The version is disabled by default when a dialect is set explicitly,
as a workaround for https://github.com/quarkusio/quarkus/issues/42255[#42255]/link:https://github.com/quarkusio/quarkus/issues/43703[#43703].
====

[[hibernate-dialect-other-databases]]
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,10 @@ interface HibernateOrmConfigPersistenceUnitDatabase {
*
* @asciidoclet
*/
// TODO change the default to "always enabled" when we solve version detection problems
// See https://github.com/quarkusio/quarkus/issues/43703
// See https://github.com/quarkusio/quarkus/issues/42255
// TODO disable the check by default when offline startup is opted in
// See https://github.com/quarkusio/quarkus/issues/13522
@WithName("version-check.enabled")
@ConfigDocDefault("`true` if the dialect was set automatically by Quarkus, `false` if it was set explicitly")
@ConfigDocDefault("`true`")
Optional<Boolean> versionCheckEnabled();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ public QuarkusRuntimeInitDialectFactoryInitiator(String persistenceUnitName,
// then the version from `DialectVersions.Defaults` will be used:
this.buildTimeDbVersion = dialect.getVersion();
this.versionCheckEnabled = runtimePuConfig.database().versionCheckEnabled()
// TODO change the default to "always enabled" when we solve version detection problems
// See https://github.com/quarkusio/quarkus/issues/43703
// See https://github.com/quarkusio/quarkus/issues/42255
// TODO disable the check by default when offline startup is opted in
// See https://github.com/quarkusio/quarkus/issues/13522
.orElse(recordedConfig.getExplicitDialect().isEmpty());
.orElse(true);
}

@Override
Expand Down

0 comments on commit f22e634

Please sign in to comment.