Skip to content

Allow per-persistence-unit control of blocking/reactive Hibernate ORM bootstrap#55382

Open
simrank0 wants to merge 1 commit into
quarkusio:mainfrom
simrank0:simrank0-hibernate-pu-blocking-config-plan
Open

Allow per-persistence-unit control of blocking/reactive Hibernate ORM bootstrap#55382
simrank0 wants to merge 1 commit into
quarkusio:mainfrom
simrank0:simrank0-hibernate-pu-blocking-config-plan

Conversation

@simrank0

@simrank0 simrank0 commented Jul 9, 2026

Copy link
Copy Markdown

Fixes #51205

quarkus.hibernate-orm.blocking is 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.reactive pattern:

quarkus.hibernate-orm."<pu-name>".jdbc=false
quarkus.hibernate-orm."<pu-name>".reactive=false

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.blocking switch untouched.

Tests: added an H2-based (container-free) test verifying "pu".jdbc=false disables blocking bootstrap for one persistence unit while a sibling is unaffected, plus two Postgres-backed compatibility tests following the existing pattern in extensions/hibernate-reactive/deployment/.../compatibility/ for the reactive side.

@quarkus-bot quarkus-bot Bot added area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive labels Jul 9, 2026
@quarkus-bot

quarkus-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

/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.
@simrank0 simrank0 force-pushed the simrank0-hibernate-pu-blocking-config-plan branch from c04e359 to a9d0d78 Compare July 9, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fine grained reactive/blocking property for specific persistence Units

1 participant