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

Remove HSQL usage, consolidate application.yaml #623

Merged
merged 2 commits into from
Sep 29, 2022
Merged

Conversation

JPercival
Copy link
Contributor

The upstream hapi-fhir-jpaserver-starter project made a few changes that make it more challenging to use an hsql database instead of h2. Specifically:

  • The jpaStarterDialectProvider in the common config doesn't rely on the same application.yaml properties as the default dialect provider, resulting in different dialects being provided
    • (we should file that as a bug upstream and fix it)
  • The driverClassName is defaulted to org.h2.Driver
  • The hibernate.dialect is defaulted to HapiFhirH2Dialect

That means that you have to override several different properties in order to configure a new database connection correctly:

  • spring.datasource.url (spring can usually auto-detect the rest of the properties from this)
  • spring.datasource.driverClassName (unset to revert automatically detecting, override to specify another driver like postgres)
  • spring.jpa.hibernate.dialect (unset to revert automatically detecting, override to specify another driver like postgres)

This PR gives up on hsql for the time being, switching back to the default H2. It also provides a new pattern for inheriting and overriding properties:

spring:
   config:
      import: classpath:org/opencds/cqf/ruler/external/application.yaml
---
spring:
   main:
      allow-bean-definition-overriding: true # the cqf-ruler plugins override serveral upstream hapi beans
---
hapi:
   fhir:
      fhir_version: R4
      server_address: "http://localhost:8080/fhir"
      openapi_enabled: true
      tester_enabled: true
      tester:
         home:
            name: Local Tester
            server_address: "http://localhost:8080/fhir"
            refuse_to_fetch_third_party_urls: false
            fhir_version: R4

      ## CQL Settings
      cql:
         # enabled: true
         engine:
            # debug_logging_enabled: false
            options: "EnableExpressionCaching"

This allows you to just import the standard hapi-fhir-jpaserver-starter properties and override only the ones you want to, shrinking down our yaml files.

@JPercival JPercival added the bug Something isn't working label Sep 29, 2022
@JPercival
Copy link
Contributor Author

Resolves #619

@JPercival JPercival linked an issue Sep 29, 2022 that may be closed by this pull request
@JPercival JPercival merged commit 9072356 into master Sep 29, 2022
@JPercival JPercival deleted the bug-h2-hsql branch September 29, 2022 03:18
@JPercival JPercival linked an issue Sep 30, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

H2/HSQL misconfiguration
1 participant