quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

Hibernate Reactive extension ignores `quarkus.hibernate-orm.datasource` #39049

Open yrodiere opened 8 months ago

yrodiere commented 8 months ago

Describe the bug

The fact that the extension doesn't support named persistence units is documented, but nowhere in the documentation does it say we can't have the default PU point to a named datasource.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

We should either document this limitation and improve feedback (error on picking a named datasource), or add support for named datasources in the Hibernate Reactive extension. I think we may as well do the latter as it's simpler.

While we're at it, we could improve build-time errors when the datasource Hibernate Reactive is supposed to use isn't configured: https://github.com/quarkusio/quarkus/pull/39005/files#r1503049286 And we could even have a more precise message when the datasource isn't reactive...

quarkus-bot[bot] commented 8 months ago

/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive)

mkouba commented 8 months ago

The fact that the extension doesn't support named persistence units is documented, but nowhere in the documentation does it say we can't have the default PU point to a named datasource.

We do mention this in the limitations but the configuration section contains unsupported properties (for example quarkus.hibernate-orm.datasource) which is IMO quite confusing...

yrodiere commented 8 months ago

We do mention this in the limitations

Are you sure? Maybe I'm dumb but I don't see anything. Note a named persistence unit is not a named datasource.

but the configuration section contains unsupported properties (for example quarkus.hibernate-orm.datasource) which is IMO quite confusing...

Yeah that can't be helped until we work on #13425 to properly separate Hibernate ORM from Hibernate Reactive. There were some shortcuts taken when initially integrating HR and they resulted in a massive technical debt.

mkouba commented 8 months ago

We do mention this in the limitations

Are you sure? Maybe I'm dumb but I don't see anything. Note a named persistence unit is not a named datasource.

Yes, I was talking about the PU, i.e. this part: "it’s not possible to configure multiple persistence units, or even a single named persistence unit"... My point is that some of the config properties in the doc are useless, including https://quarkus.io/guides/hibernate-reactive#quarkus-hibernate-orm_quarkus-hibernate-orm-persistence-units-additional-named-persistence-units...

yrodiere commented 8 months ago

Ok so that's what I thought: the limitation is not documented.

And yes the list of configuration properties is confusing. It changes on 3.9, but I'm not sure it's less confusing :/ https://quarkus.io/version/main/guides/hibernate-reactive#hr-configuration-properties