Skip to content

Conversation

@lucamolteni
Copy link
Contributor

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-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

@lucamolteni lucamolteni marked this pull request as ready for review November 21, 2025 12:19
@lucamolteni lucamolteni requested a review from yrodiere November 21, 2025 12:19
@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive labels Nov 21, 2025
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 21, 2025

/cc @gsmet (hibernate-orm)

@lucamolteni lucamolteni requested a review from mbellade November 21, 2025 12:20
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Nov 21, 2025

🎊 PR Preview 70552ed has been successfully built and deployed to https://quarkus-pr-main-51159-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@quarkus-bot

This comment has been minimized.

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! 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.

Comment on lines +16 to +17
// TODO Luca add deprecation version
@Deprecated(since = "version")
Copy link
Member

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.

…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
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 24, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 82c6135.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

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.

LGTM! Please set the @Deprecated(since) and we're good to merge.

@yrodiere
Copy link
Member

Also please squash :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive triage/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hibernate default blocking PU + named reactive PU causes errors Hibernate Extension: Check the error message when multiple JDBC Driver

3 participants