Skip to content
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

MutiTenant Db is not working when using two different databases #691

Open
rajadilipkolli opened this issue Jan 22, 2025 · 0 comments
Open
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@rajadilipkolli
Copy link

rajadilipkolli commented Jan 22, 2025

The current sample provided in this repo is working as long as database type is same like here where both databases are of type postgresql

When I tried to move one database configuration to another database say mariadb, as its dialect is different receiving syntax errors while saving the data like below

2025-01-22T22:42:07.860+05:30 ERROR 39800 --- [multitenancy-db] [omcat-handler-0] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet [(conn=103) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''public.customers_seq')' at line 1] [select nextval('public.customers_seq')]; SQL [select nextval('public.customers_seq')]] with root cause

Use case here is till 2024 customer has used mariadb and now they are moving to postgresql. They want to migrate to postgresql gradually so as of now based on some business logic they want to query mariadb and postgresql as per outcome.

How to set different databases using same entity and same repository?
cc : @schauder

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants