Skip to content

Make it possible to start without connecting to the database #47695

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

Closed
wants to merge 1 commit into from

Conversation

AB-xdev
Copy link
Contributor

@AB-xdev AB-xdev commented May 5, 2025

Fixes #30002

See #30002 (comment) for details

@quarkus-bot quarkus-bot bot added the area/hibernate-orm Hibernate ORM label May 5, 2025
Copy link

quarkus-bot bot commented May 5, 2025

/cc @gsmet (hibernate-orm)

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but as you can imagine, testing and handling edge cases -- as mentioned in #30002 (comment) -- is actually the most time-consuming part of fixing this.

We'll need someone (you? :) ) to handle that as well.

If you need help, feel free to ping me on https://quarkusio.zulipchat.com/

@yrodiere
Copy link
Member

yrodiere commented May 5, 2025

FWIW, regarding this:

I e.g. don't know how I'm supposed to set a config value ("should default to none when asked to start offline") when there is only an interface available...

The interfaces expose configured values to the Quarkus extension, but the extension is free to interpret them before passing values over to Hibernate ORM.

In this case, changing the default would be about:

  1. Changing this:
    to that:
    // REMOVE @WithDefault!
    Optional<String> strategy();
    
    ... so you can detect that the value is not set.
  2. Changing code that calls that method (e.g.
    runtimeSettingsBuilder.put(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION,
    persistenceUnitConfig.database().generation().generation()
    .orElse(persistenceUnitConfig.schemaManagement().strategy()));
    , but also other places ) so that it adapts the default depending on the value of startOffline, and triggers an exception (io.quarkus.runtime.configuration.ConfigurationException would make sense here, I think?) when the value is set, but conflicts with startOffline.

@AB-xdev
Copy link
Contributor Author

AB-xdev commented Jun 2, 2025

I think this PR can probably be closed in favor of #48130 which has all/most of the required changes and is done by a Quarkus dev (who is probably knows the code 10x better than me) :)

Anyway thank you for your efforts!

@yrodiere
Copy link
Member

yrodiere commented Jun 2, 2025

Thank you; closing in favor of #48130

@yrodiere yrodiere closed this Jun 2, 2025
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hibernate ORM tries to connect to the database on startup even with schema validation disabled
2 participants