Managing database caches in the PowerServer solution

When the PowerServer project is built and deployed in the PowerBuilder IDE, the cache settings (including database server host/port, database name, login ID, password, advanced settings etc.) configured in the Database Configuration window will be deployed and stored in the PowerServer C# solution. You can manually change these settings in the PowerServer C# solution.

To manage database caches in the ServerAPIs project of the PowerServer solution:

  1. Open the PowerServer C# solution > ServerAPIs project > AppConfig > Applications.json file.

    The Applications.json file contains the configuration of the "Default" DB connection profile. If you have another connection profile, the profile name is added in the middle of the file name. For example, Applications.Development.json file contains the configuration of the "Development" DB connection profile.

  2. In the Applications.json file, locate the "Connections" block. This is where the cache(s) is stored.

    In the following example, there are two caches "local-sa" and "local-postgresql" under the "Default" cache group; and each cache contains the database connection information that are configured and deployed from the Database Configuration window. You can modify the existing cache, or create a new cache by making a copy of the existing one.

    ...
      "Connections": {
        "Default": {
          "local-sa": {
            "ConnectionType": "Odbc",
            "OdbcName": "PB Demo DB V2021",
            "OdbcDriver": "SqlAnywhere",
            "UserID": "dba",
            "Password": "eyJQYXlsb2FkIjoiYlx1MDAyQkxocTNiMUtWSzhBY1FCbVltU0FBPT0iLCJUaW1lc3RhbXAiOjE2MjU2NDYwNDcsIlNpZ25hdHVyZSI6IkF5V253VzNVNVx1MDAyQk5mNUxOd2RGTG83alVQeWRVYlpaUEtWcG5PU012cVx1MDAyQm95RTVtVlkwblQ3NHVqSFBHcm5NdVVQQUhnRFhKSklRZ1hiZ2c3Y3hGSG1jZz09In0=",
            "CommandTimeout": 30,
            "OtherOptions": "",
            "DynamicConnection": false
          },
          "local-postgresql": {
            "ConnectionType": "PostgreSql",
            ...
          }
        }
      }

    Note: (1) The PowerServer C# solution will be updated every time when the PowerServer project is built and deployed in the PowerBuilder IDE. If you manually modify the settings in Applications.json, and want to keep these changes, you should use the "Overwrite server settings (DB connection, Web API port, and license)" option properly. For more information, refer to What settings will be deployed to the solution. (2) If you want to change the database driver, you must make changes in the project settings and then re-deploy the project from the PowerBuilder IDE. Changing the driver directly in the PowerServer solution would cause failure in the running of the installable cloud app.