-
Notifications
You must be signed in to change notification settings - Fork 3k
Offline startup and dialect configuration for Hibernate ORM #48130
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
Conversation
/cc @gsmet (hibernate-orm,hibernate-search), @marko-bekhta (hibernate-search) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM overall, though I have concerns about the temporary table thing -- see below.
To be merged after #41310 as it's based on @yrodiere Hibernate 7 branch, creating a Draft PR
FWIW if you're only going to address #30002 (and not #13522) in this PR, you can probably base your work on main
. I don't expect anything here to require the upgrade to ORM 7, and this would allow merging your PR more quickly.
...-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
Show resolved
Hide resolved
...loyment/src/test/java/io/quarkus/hibernate/orm/offline/StartOfflineSchemaManagementTest.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/quarkus/hibernate/orm/runtime/HibernateOrmRuntimeConfigPersistenceUnit.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/quarkus/hibernate/orm/runtime/HibernateOrmRuntimeConfigPersistenceUnit.java
Outdated
Show resolved
Hide resolved
...ime/src/main/java/io/quarkus/hibernate/orm/runtime/FastBootHibernatePersistenceProvider.java
Outdated
Show resolved
Hide resolved
Can someone give me an update on the current state of the PR? We're still eagerly waiting for this feature :) |
As you can see, it's work in progress. Luca is otherwise occupied right now and will come back to it. |
5082566
to
bf33cd9
Compare
🙈 The PR is closed and the preview is expired. |
485a43e
to
7adc22c
Compare
...loyment/src/test/java/io/quarkus/hibernate/orm/config/DevUISchemaManagementStrategyTest.java
Outdated
Show resolved
Hide resolved
...-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
Show resolved
Hide resolved
Those tests disable DevServices rather enabling it, so I assume they're always enabled implicitly and the last commit to test is fine (with the Dev UI text fixed) ok? |
Yes they're enabled implicitly in tests: https://github.com/quarkusio/quarkus/blob/81042d375abf7300274fcdd5d4454da09d90d5a5/integration-tests/hibernate-search-orm-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/devservices/HibernateSearchElasticsearchDevServicesEnabledImplicitlyTest.java
Yes that commit looks good to me |
1d4502a
to
f3def84
Compare
This comment has been minimized.
This comment has been minimized.
This seems related to this patch, it happens only in Native mode
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…Hibernate Reactive quarkusio#48130 Added a `quarkus.hibernate-orm.database.start-offline` to avoid connecting to the database * Disable schema validation * Disable temporary table creation at startup, gives precedence to local temporary tables using Hibernate 7.1 local mutation strategies * Disable schema management in offline mode for DevServices as well New way to handle storage engine from both mysql and mariadb Added tests for specific override of Dialect Settings Removed unused hack MultiplePersistenceUnitsInconsistentStorageEnginesTest$H2DialectWithMySQLInTheName Included initial draft by Steve Ebersole <[email protected]> quarkusio#43396 Co-authored-by: Steve Ebersole <[email protected]> Co-authored-by: Yoann Rodière <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…Hibernate Reactive quarkusio#48130 Added a `quarkus.hibernate-orm.database.start-offline` to avoid connecting to the database * Disable schema validation * Disable temporary table creation at startup, gives precedence to local temporary tables using Hibernate 7.1 local mutation strategies * Disable schema management in offline mode for DevServices as well New way to handle storage engine from both mysql and mariadb Added tests for specific override of Dialect Settings Removed unused hack MultiplePersistenceUnitsInconsistentStorageEnginesTest$H2DialectWithMySQLInTheName Included initial draft by Steve Ebersole <[email protected]> quarkusio#43396 Co-authored-by: Steve Ebersole <[email protected]> Co-authored-by: Yoann Rodière <[email protected]>
This comment has been minimized.
This comment has been minimized.
After having registered strategies for reflection, native image tests are passing The local temporary table strategies part will be removed when local temporary table scripts will be added to |
|
…Hibernate Reactive quarkusio#48130 Added a `quarkus.hibernate-orm.database.start-offline` to avoid connecting to the database * Disable schema validation * Disable temporary table creation at startup, gives precedence to local temporary tables using Hibernate 7.1 local mutation strategies * Disable schema management in offline mode for DevServices as well New way to handle storage engine from both mysql and mariadb Added tests for specific override of Dialect Settings Removed unused hack MultiplePersistenceUnitsInconsistentStorageEnginesTest$H2DialectWithMySQLInTheName Register for reflection the local temp strategies otherwise Native compilation is broken (to be removed after https://hibernate.atlassian.net/browse/HHH-15525) Included initial draft by Steve Ebersole <[email protected]> quarkusio#43396 Co-authored-by: Steve Ebersole <[email protected]> Co-authored-by: Yoann Rodière <[email protected]>
This comment has been minimized.
This comment has been minimized.
Status for workflow
|
Status for workflow
|
…Hibernate Reactive quarkusio#48130 Added a `quarkus.hibernate-orm.database.start-offline` to avoid connecting to the database * Disable schema validation * Disable temporary table creation at startup, gives precedence to local temporary tables using Hibernate 7.1 local mutation strategies * Disable schema management in offline mode for DevServices as well New way to handle storage engine from both mysql and mariadb Added tests for specific override of Dialect Settings Removed unused hack MultiplePersistenceUnitsInconsistentStorageEnginesTest$H2DialectWithMySQLInTheName Register for reflection the local temp strategies otherwise Native compilation is broken (to be removed after https://hibernate.atlassian.net/browse/HHH-15525) Included initial draft by Steve Ebersole <[email protected]> quarkusio#43396 Co-authored-by: Steve Ebersole <[email protected]> Co-authored-by: Yoann Rodière <[email protected]>
Replaced by #49408 (it's the same thing, but rebased by @mbellade as @lucamolteni is off) |
Enable automatic failure on unrecognized configuration properties in test mode by default. Tests now fail fast when configuration typos are detected, eliminating the need for manual log assertions. Users can opt-out with .failOnUnknownProperties(false) when needed. - Add failOnUnknownProperties field to LaunchMode enum (default true for TEST mode) - Enhance ConfigDiagnostic.unknown() to throw IllegalArgumentException when strict mode enabled - Update ConfigGenerationBuildStep to always pass LaunchMode to validation - Add failOnUnknownProperties() method to QuarkusUnitTest for opt-out capability - Maintain backward compatibility: production mode unchanged, warnings only See quarkusio#48130 (comment)
Enable automatic failure on unrecognized configuration properties in test mode by default. Tests now fail fast when configuration typos are detected, eliminating the need for manual log assertions. Users can opt-out with .failOnUnknownProperties(false) when needed. - Use System property `quarkus.debug.fail-on-missing-properties` for feature flag - Enhance ConfigDiagnostic.unknown() to throw IllegalArgumentException when strict mode enabled - Add failOnUnknownProperties() method to QuarkusUnitTest for opt-out capability - Maintain backward compatibility: production mode unchanged, warnings only See quarkusio#48130 (comment) # Release notes Added property `quarkus.debug.fail-on-missing-properties` to make application fail when an unknown property is being set
Fixes: #30002 (comment)
Based on the original work of https://github.com/xdev-software https://github.com/quarkusio/quarkus/pull/47695/files
This handles some of the issues addressed in #30002 (comment)
To be added in the Migration Guide:
Hibernate ORM
MySQL/MariaDB storage engine
Setting the MySQL/MariaDB storage engine through property
quarkus.hibernate-orm.dialect.storage-engine
has been deprecated.Use one of these configuration keys instead:
Done:
io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitDatabase#versionCheckEnabled should default to false when asked to start offline, and lead to an exception with a clear message when it's explicitly set to true while starting offline.