-
Notifications
You must be signed in to change notification settings - Fork 3k
Offline startup and dialect configuration for Hibernate ORM #49408
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
…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]>
/cc @gsmet (hibernate-orm) |
Status for workflow
|
🙈 The PR is closed and the preview is expired. |
.application.properties | ||
---- | ||
quarkus.hibernate-orm."offline".dialect.mariadb.bytes-per-character=1 | ||
quarkus.hibernate-orm."offline".dialect.mariadb.no-backslash-escapes=true |
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.
it really needs these quotes? I understand the technical aspect but as a user, this feels off.
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.
I believe the "offline"
is just to denote a PU-specific setting, the quotes are not strictly necessary.
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.
ohh that's much better, thanks 👍
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.
I guess this will have to do for now, but the tests seem a bit odd to me:
they are testing that, having set a certain property, the property is set.
Surely we need to test their impact on different semantics and behaviour?
As follow ups we should test that the dialect specific options are being applied in practice, not just that the property has been set.
I'll let @lucamolteni elaborate on the tests topic, but those asserting dialect specific-properties were not meant as full-on "integration tests', i.e. validating that Hibernate ORM and its dialects act according to the configuration, but more like pseudo-unit tests providing validation that the dialect checks within Quarkus' ORM extension work correctly and set the properties on the session factory - then it's Hibernate's concern whether they work correctly within the dialect. I also had some concerns regarding those, especially since they use |
Status for workflow
|
Added to https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.26 |
This also fixes #13522 . Linking... |
Yes exactly, they test a transformation (key seems identical, but one it's a quarkus configuration property, the other is an hibernate session property) and a side-effect (configuration is inside the hibernate session). It's worth testing IMHO |
+1. Testing the full behavior would be nice, but would mostly be useful if we tested in native mode (where the risk is highest), and we obviously cannot have a native integration test for every single property. So when the risk is small, testing that we propagate the setting is IMO a good strategy. |
This is only a rebase of @lucamolteni's work in #48130 now that Hibernate has been upgraded to 7.1 via #49344.
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: