Skip to content

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

Open
@rajadilipkolli

Description

@rajadilipkolli

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions