-
Notifications
You must be signed in to change notification settings - Fork 3k
Prevent startup failing when having mismatched datasource types #51159
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
base: main
Are you sure you want to change the base?
Conversation
|
/cc @gsmet (hibernate-orm) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b5cfbc9 to
36ee8d3
Compare
This comment has been minimized.
This comment has been minimized.
|
🎊 PR Preview 70552ed has been successfully built and deployed to https://quarkus-pr-main-51159-preview.surge.sh/version/main/guides/
|
This comment has been minimized.
This comment has been minimized.
yrodiere
left a comment
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 except for some comments that I had a hard time understanding, and of course the deprecation version that you mentioned in the PR's description.
...ent/src/main/java/io/quarkus/reactive/datasource/deployment/ReactiveDataSourceProcessor.java
Outdated
Show resolved
Hide resolved
| // TODO Luca add deprecation version | ||
| @Deprecated(since = "version") |
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.
Adding a comment here so that we don't merge this unfixed.
.../src/test/resources/application-unittest-both-named-reactive-and-default-blocking.properties
Show resolved
Hide resolved
...ate/reactive/compatibility/ORMReactiveCompatibilityNamedReactiveDefaultBlockingUnitTest.java
Outdated
Show resolved
Hide resolved
...ate/reactive/compatibility/ORMReactiveCompatibilityNamedReactiveDefaultBlockingUnitTest.java
Outdated
Show resolved
Hide resolved
...ibility/ORMReactiveCompatbilityDifferentNamedDataSourceNamedPersistenceUnitBothUnitTest.java
Show resolved
Hide resolved
...-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
Show resolved
Hide resolved
…en Hibernate ORM (blocking) and Hibernate Reactive by validating datasource configuration at build time. - Blocking persistence units are not created when only reactive datasources are configured - Reactive persistence units are not created when only blocking datasources are configured - Clear error messages are provided when datasources are missing - Created HibernateDataSourceUtil with shared datasource lookup logic - Extracted ReactiveDataSourceBuildItem to new `quarkus-reactive-datasource-spi` module to enable reactive data source checking in the Hibernate ORM extension - Refactored HibernateOrmProcessor and HibernateReactiveProcessor to validate datasource types and don't create the PU when there's no appropriate DS - Fail correctly when using a single extension but the datasource name is mismatched - Fixed ORMReactiveCompatbilityDifferentNamedDataSourceNamedPersistenceUnitBothUnitTest which was incorrectly passing due to dev services - Added new test cases for mixed datasource scenarios Fixes quarkusio#50634 quarkusio#47036
36ee8d3 to
82c6135
Compare
Status for workflow
|
yrodiere
left a comment
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.
LGTM! Please set the @Deprecated(since) and we're good to merge.
|
Also please squash :) |

TODO: needs deprecation version in original ReactiveDataSourceBuildItem
Prevent startup failing when having mismatched datasource types between Hibernate ORM (blocking) and Hibernate Reactive by validating datasource configuration at build time.
Blocking persistence units are not created when only reactive datasources are configured
Reactive persistence units are not created when only blocking datasources are configured
Clear error messages are provided when datasources are missing
Created HibernateDataSourceUtil with shared datasource lookup logic
Extracted ReactiveDataSourceBuildItem to new
quarkus-reactive-datasource-spimodule to enable reactive data source checking in the Hibernate ORM extensionRefactored HibernateOrmProcessor and HibernateReactiveProcessor to validate datasource types and don't create the PU when there's no appropriate DS
Fail correctly when using a single extension but the datasource name is mismatched
Fixed ORMReactiveCompatbilityDifferentNamedDataSourceNamedPersistenceUnitBothUnitTest which was incorrectly passing due to dev services
Added new test cases for mixed datasource scenarios