-
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
JPA Security: allow pointing to a named persistence unit #35231
Comments
/cc @sberyozkin (security) |
Also CC @FroMage @michalvavrik |
Yeah, probably a nice idea. |
I've tried to figure how to do this for Hibernate Reactive (JPA Security Reactive), but I don't believe it is possible to use named PU with HR. At least I didn't find any test / any example / any docs and in tests I wrote Mutiny.SessionFactory was not produced for named PU. #36728 should take care of this for Security JPA. |
Indeed it is not: https://quarkus.io/guides/hibernate-reactive#hr-limitations ,
Thanks! |
Completely missed that line, thank you. |
Description
Currently,
JpaIdentityProvider
is hardcoded to retrieve the default persistence unit:quarkus/extensions/security-jpa/runtime/src/main/java/io/quarkus/security/jpa/runtime/JpaIdentityProvider.java
Lines 22 to 27 in 03df5d5
This means security-related data must live in the default PU and cannot live in a named PU, which seems like a likely scenario.
It would be nice to allow configuring quarkus-security-jpa to use a non-default persistence unit.
See also https://stackoverflow.com/questions/76845856/unsatisfied-dependency-with-panache-and-multiple-datasources
Implementation ideas
AFAICS we just need some more config in the quarkus-security-jpa extension and corresponding build steps to have
JpaIdentityProvider
retrieve theEntityManagerFactory
by name if necessary.The text was updated successfully, but these errors were encountered: