-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #13425 Hibernate ORM and Hibernate Reactive cannot be used in the same application #44473
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! Your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
Thanks! I'll have a closer look tomorrow, but a few early comments:
Can this be more "hidden"? E.g. move the annotation to a clearly internal package, or even just don't make it a bean for Hibernate Reactive. The reason I'm asking is that users really shouldn't be using the
A few things:
|
I agree with your point, I'll work on it and see if I can hide it somehow. But yes it's just a matter of CDI injection (answering also 1 below)
I don't see how this should prevent the multiple units to be implemented, it's something that has to be done from scratch anyway
I saw that as well, but I also saw the original persistence unit default string hardcoded and that was a problem, so I thought that keeping it separated would be better. |
Impressive. I've no idea how to support this in Panache, though 😱 |
This comment has been minimized.
This comment has been minimized.
…ave a JDBC data source we don't generate the blocking pU
e670280
to
db5dbb5
Compare
Fixes #13425
I've added a test to verify the compatibility of both the extensions together.
This is not a big refactor as both extensions are still coupled together, but this lets users use both implementation in their Quarkus application.
The idea is to have a MultiplePersistenceProviderResolver https://github.com/quarkusio/quarkus/compare/main...lucamolteni:13425-ter?expand=1#diff-c1c6c402fc142de3b1c4d726cb080f2b856cf560b693a1686f52ad3a35a972f0R10
And filter the correct one at runtime
https://github.com/quarkusio/quarkus/compare/main...lucamolteni:13425-ter?expand=1#diff-db8c5c1b299098a43c5d8e4b3f3267e4bb72c6e7841536d9bbb487dcff8c54ffR88
There's also a new ReactivePersistenceUnit annotation https://github.com/quarkusio/quarkus/compare/main...lucamolteni:13425-ter?expand=1#diff-8c10ee8583155144d5c9f796e33b785471701a346c768b2f707fe3a036f0590dR24 in order to disambiguate the correct bean to be injected.
I've also changed the default name for the reactive persistence unit as there are effectively two together and they can't share the same name.
Connection strings are in two different fields so they don't collide
https://github.com/quarkusio/quarkus/compare/main...lucamolteni:13425-ter?expand=1#diff-6dd4fdea2c39574c084d9b03d106b6dd15b4877db728858cebf88641216bcd72R13
Feedbacks are welcome