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

Problem creating Hibernate dialect with specific version #5723

Closed
smals-pano opened this issue Feb 21, 2024 · 0 comments · Fixed by #5725
Closed

Problem creating Hibernate dialect with specific version #5723

smals-pano opened this issue Feb 21, 2024 · 0 comments · Fixed by #5725

Comments

@smals-pano
Copy link
Contributor

smals-pano commented Feb 21, 2024

Describe the bug
When setting the Hibernate dialect to ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect it fails using the constructor with a specific version and falls back to the default (10.0.0) version creating a warning in the logs for an unsupported version:

org.hibernate.dialect.Dialect : HHH000511: The 10.0.0 version for [ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect] is no longer supported, hence certain features may not work properly. The minimum supported version is 12.0.0. Check the community dialects project for available legacy versions.

To Reproduce

  1. Set the hibernate dialect to ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
  2. Start the application
  3. View the warning in the logs

Expected behavior
Warning not appearing and the used Postgres version set.

Environment (please complete the following information):

  • HAPI FHIR Version: 7.0.0

Additional context
org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl#constructDialect expects a dialectClass constructor with a DialectResolutionInfo parameter. HapiFhirPostgresDialect only has a default constructor and one with a DatabaseVersion parameter.

Suggested solution
Add an extra constructor in HapiFhirPostgresDialect with the required parameter:
HapiFhirPostgresDialect(DialectResolutionInfo dialectResolutionInfo)

smals-pano added a commit to smals-pano/hapi-fhir that referenced this issue Feb 21, 2024
jamesagnew added a commit that referenced this issue Apr 19, 2024
* bugfix: creating Hibernate dialect with specific version

fixes #5723

* Apply fix to other dialects, and add changelog

* Spotless

---------

Co-authored-by: James Agnew <jamesagnew@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant