Open kazik666 opened 2 years ago
/cc @DavideD, @Sanne, @gavinking
Any news?
cc @gsmet
Hi. Why isn't multiple persistence units supported for Hibernate Reactive? The original hibernate reactive seems to support multiple persistence unit. What's the concern about this? I think add an annotation with persistence unit name and use producer method with InjectionPoint will be able to produce the Mutiny.SessionFactory for the specific persistence unit. Why not? And I'd like to know the reason why persistence.xml is not supported for Hibernate Reactive.
I see that resteasy-reactive has become the default rest layer. So I'd like to write whole app in reactive style. But the Hibernate Reactive is not with all the features I need.
Hi. Why isn't multiple persistence units supported for Hibernate Reactive? The original hibernate reactive seems to support multiple persistence unit. What's the concern about this?
There's no instrinsic limitation, as you noticed Hibernate Reactive upstream can deal with multiple persistence units and we do plan to eventually support this in Quarkus as well.
But currently the Hibernate Reactive extension for Quarkus is in a problematic shape: it's highly coupled to the core of the Hibernate ORM blocking extension, and the presence of it actually taints the state of the blocking ORM instances. It needs to be rewritten with a more flexible design.
But we're aiming to support Hibernate ORM 6 first, and in terms of project steering it's not a good idea to have these big initiatives working in parallel; since we know Hibernate Reactive also needs substantial changes to make itself ready for ORM6, I feel that re-implementing the Hibernate Reactive extension for Quarkus is better deferred to when such other tasks have been done.
This is the order in which I expect us to make progress:
Since there's already big changes being made in parallel across all projects, it would be problematic to start the refactoring of the Hibernate Reactive extension in parallel as well. Not least because it's the same people working on these points, so it's not like we'd finish faster :)
And I'd like to know the reason why persistence.xml is not supported for Hibernate Reactive.
The persistence.xml
support for Hibernate ORM blocking is meant as a facilittion for people who are migrating from JPA.
I don't think people who are creating a brand new application in Quarkus should use a persistence.xml
, and since clearly Hibernate Reactive users aren't - at least eaily - going to expect "copying over" an existing persistence layer, this facility isn't very useful for an Hibernate Reactive user.
I might be wrong, I'm actually interested why you're asking for it? How important is that for you?
Hi @Sanne seems there has been somework on this. Is this now being planned for being supported in Quarkus. We now do Reactive APP + Jdbc Database conneciton via agroal.
Actually, since we hit this limitation in our case as well, we need to take an architectural decision on our side and use the plain hibernate ORM, but the rest of our service is written in RESTEasy Reactive.
Question: does Resteasy Reactive play nicely with the plain Hibernate (non-reactive) client without having any issues later down the road for the microservices that mix those two?
Yes, RESTEasy Reactive works perfectly with both flavors of Hibernate
Hey @Sanne, could you please update if multiple persistence units supported by latest quarkus version?
Hey @Sanne, could you please update if multiple persistence units supported by latest quarkus version?
Main branch docs says it is not https://quarkus.io/version/main/guides/hibernate-reactive#hr-limitations.
Is there any update on this ticket or any ideas when this will be fixed?
Describe the bug
In my test application.yaml I have configuration like below:
When I'am running tests I see warning message in console:
WARN: Skipping registration of ReactiveSessionFactoryProducer and ReactiveSessionProducer because exactly one persistence unit is required for their registration
And after that test failed with:
java.lang.NullPointerException: Cannot invoke "org.hibernate.reactive.mutiny.Mutiny$Session.createQuery(String)" because "em" is null
Expected behavior
Two persistent reactive units should be initialized properly.
Actual behavior
Non of reactive persistent units was initialized.
How to Reproduce?
No response
Output of
uname -a
orver
Linux 5.13.0-20-generic #20-Ubuntu SMP Fri Oct 15 14:21:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
16.0.2
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.4.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.2
Additional information
No response