Open Closed

Unable to use desired database name #7696


User avatar
0
omer_yel created
  • ABP Framework version: v8.2
  • UI Type:Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

We have released app named "projectNameX". Then placed it on two different server for release and test stage. They have different database names like "projectNameX_Dev" and "projectNameX_Test". We have issue on "projectNameX_Test" and "projectNameX_Dev" database connection. Even if we set connection string as "projectNameX_Test' and "projectNameX_Dev" , requests are used "projectNameX.dbo.tableName". We are getting below error. Table can not be found.

Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name projectNameX.dbo.tableName

Otherwise we change connection string to "projectName", it works.

Is there any way to set desired database name?


7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can set different ConnectionStrings in different appsettings.json for the dev and test environments.

    Did you set the tenant's ConnectionStrings info?

    Can you share your code or steps to reproduce the problem?

    Thanks

  • User Avatar
    0
    omer_yel created

    Hi There are two servers and two mssql dbs. And there is also two same release app. We want to deploy them on separate servers. We deployed first released app with database which has same name as project name. It properyl works. In other hand, we tried to use second release app with database which has different name than project name. It throw error.

    Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name projectName.dbo.tableName

    I think, it tries to find table on database with name same as project name. We set database names in appsettings.json for each server.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You should use different Redis servers for these two applications.

  • User Avatar
    0
    omer_yel created

    Hi Yes they are using separate Redis.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share your release app?

    I will try to change it on my local.

    liming.ma@volosoft.com

  • User Avatar
    0
    omer_yel created

    Hi We have created new project using suite in order to share with you. We set database name different name than project name. This time it worked. Also we set new database one of servers for released project that we are getting error. This new database name is also different than projectname. If project name is "ProjectX" , we have set database name as "ProjectXDB". It also worked. We could not get it how it worked. Now project can work with database name as same project name and different form project name. While we are working on this issue, i have new issue to ask you. If you do not mind we want to ask it on this ticket. We get Invalid token message when try reset password. We use reset password page of abp so you and other services of abp like GenerateResetPasswordToken etc. This method generate token there isn't problem but i get invalid token message when use token to reset password via generated link. And we tried other way direct via endpoint which called "change-password" with token which take from auth server with client_id and secret. But i get 401 error (Token hasn't audience claim) when i put to endpoint. By the way we try access endpoint in same program(No Tiered; Blazor and Auth same). So how can i solve this problems? We tried disable valid audience but don't work. We are waiting your help and supports.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    For the Invalid token Please create a new question. Thanks.

Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13