-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Hibernate Reactive can't be used when agroal extension is present #33380
Comments
/cc @DavideD (hibernate-reactive), @Sanne (agroal,hibernate-reactive), @barreiro (agroal), @gavinking (hibernate-reactive), @yrodiere (agroal) |
How changing the implementation of defineTypeOfImpliedPU to something like that:
This fix passes all unit & integration tests (and a new integration test for this specific case), and actually fixes the issue. If no jdbc datasource is used for hibernate it assumed a non blocking persistent unit. I admit the implementation could be better, but hey, it works. |
Please send a PR if it's not too much work, it'll be easier to determine what's going on with an actual diff. |
@yrodiere I opened an initial PR so you can "catch the drift" of the problem and suggested solution |
Describe the bug
When Agroal extension is added as a depedency along side a reactive sql client, hibernate reactive can't be used.
As described in other issues, this prevents using reactive datasource along side flyway, liquibase, quartz etc. as they require a blocking datasource.
Once the agroal extension is present it automatically adds a jdbcdatasource that gets detected by the hibernate orm extension which is preset as a transient dependency for hibernate reactive.
This seems to actually boil down to the defineTypeOfImpliedPU method in the HiberanateOrmProcessor.
Other issues mentions that this can be fixed when Quarkus migrates to hibernate 6 and hibernate reactive 2.0, but it really seems like a "naive" assumption in the hibernate orm quarkus extension, which can be (hopefully) easy to fix by either allowing the user to disable blocking hibernate persistence unit, or by detecting the persistent unit associated datasource flavor (reactive or blocking).
#10716 (comment)
#13425
Expected behavior
When using Hibernate reactive with a reactive datasource configured, adding the agroal extension and configuring a blocking datasource, without associating it to hibernate persistence unit won't affect hibernate blocking/reactive mode.
Actual behavior
Configuring Hibernate Reactive with a reactive datasource as the datasource, while also adding another blocking datasource using agroal, causes all sort of exceptions due to the generation of ImpliedBlockingPersistenceUnitTypeBuildItem.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
17
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.0.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.0.2
Additional information
No response
The text was updated successfully, but these errors were encountered: