Allow per-persistence-unit control of blocking/reactive Hibernate ORM bootstrap#55382
Open
simrank0 wants to merge 1 commit into
Open
Allow per-persistence-unit control of blocking/reactive Hibernate ORM bootstrap#55382simrank0 wants to merge 1 commit into
simrank0 wants to merge 1 commit into
Conversation
|
/cc @gsmet (hibernate-orm) |
… bootstrap Add quarkus.hibernate-orm."<pu-name>".jdbc and .reactive boolean properties, mirroring quarkus.datasource.jdbc/reactive. Each persistence unit can now independently opt in or out of blocking (JDBC) or reactive bootstrap, instead of relying only on the global quarkus.hibernate-orm.blocking switch or on inference from the configured datasource kind. When unset, behavior is unchanged: the decision is still inferred from the available datasource for that persistence unit.
c04e359 to
a9d0d78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51205
quarkus.hibernate-orm.blockingis currently a global switch: it enables or disables blocking (JDBC) Hibernate ORM bootstrap for every persistence unit at once. There was no way to make one persistence unit blocking-only, another reactive-only, and a third both, other than relying on datasource-kind inference (which doesn't help with custom connection providers or when the inference doesn't match user intent).This adds two per-persistence-unit boolean properties, mirroring the existing
quarkus.datasource.jdbc/quarkus.datasource.reactivepattern:When unset, behavior is unchanged — Quarkus still infers whether a persistence unit should be blocking, reactive, or both from the kind of datasource it resolves to. Setting either property explicitly overrides that inference for that specific persistence unit only, leaving other persistence units and the global
quarkus.hibernate-orm.blockingswitch untouched.Tests: added an H2-based (container-free) test verifying
"pu".jdbc=falsedisables blocking bootstrap for one persistence unit while a sibling is unaffected, plus two Postgres-backed compatibility tests following the existing pattern inextensions/hibernate-reactive/deployment/.../compatibility/for the reactive side.