-
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
StackOverflowException is thrown when read database config in TenantConnectionResolver
#19563
Comments
/cc @evanchooly |
@hanzhenliang can you provide a sample on how you are reading the database from your |
@gastaldi I just injected the panache repository in my custom
|
Right, so what happens if you |
I don't have
|
I should have explained what I'm doing a little bit earlier. I'm building a multiple tenant application which will have a default Every time the |
Right, so you can't use the Panache API in there because using it would require triggering the same |
This error looks similar to #19467 |
Here is the
|
The same issue. |
We'll close this issue and track in #19467. Thanks for your feedback! |
Hi, I tried another approach that I created 2 persistence units, one is default which stores the tenant config, the other is specified for tenants. I don't have StackOverflowException but the same ContextIsNotActiveException. The stacktrace:
The config:
|
@hanzhenliang Yes, that is fixed in Quarkus 2.2.0 Final |
Describe the bug
I have a default datasource which stores tenant configurations including database config, and store other data per tenant per database. I tried to read database config in
TenantConnectionResolver
, but got StackOverflowException at the end.Expected behavior
StackOverflowException
is thrown.Actual behavior
The
PanacheRepository
injected inTenantConnectionResolver
should use default datasource instead of resolving fromTenantConnectionResolver
.How to Reproduce?
https://github.com/quarkusio/quarkus-quickstarts/tree/main/hibernate-orm-multi-tenancy-quickstart
Read database config in
TenantConnectionResolver
.Output of
uname -a
orver
Darwin C02T81GVG8WL 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 22 19:49:55 PDT 2021; root:xnu-6153.141.35~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.1.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 6.9 ------------------------------------------------------------ Build time: 2021-05-07 07:28:53 UTC Revision: afe2e24ababc7b0213ccffff44970aa18035fc0e Kotlin: 1.4.20 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 11.0.9.1 (AdoptOpenJDK 11.0.9.1+1) OS: Mac OS X 10.15.7 x86_64
Additional information
No response
The text was updated successfully, but these errors were encountered: