Question about DatabaseConnection_SetConnectionStringForSession

Hi everyone!

What's the point of the DatabaseConnection_SetConnectionStringForSession having both a parameter for the connection name as defined in Service Center *and* a parameter for the actual connection string?

Since the connection string is already defined in Service Center, what's the point of having to specify it again in the action? From my testing the action will pretty much ignore whatever you put in the connection name parameter, except that the action will fail silently if there's no DB connection with that name, so why does it even exist and, worse than that, is mandatory?

Also, does the database change apply just to extensions? In Service Center it clearly says that the Database Connection setting only applies to extension: "Database Connections are used by extensions for integration with external databases.", but both in the actual name of the action (DatabaseConnection_SetConnectionStringForSession) and in the documentation ("Switches a Database Connection from one database to another at runtime and in the current Session.") this is a lot less vague.

Thanks for any pointers on this!


Hi Carlos,

The purpose of this API is to change the connection string of a specific database connection created on service center for the current session. That is why you need to specify which is the database connection name you are changing. This way the platform can know that everywhere that database connection is being used during that session, the connection should be changed by the connection string specified with the API.

You can find more details about this API on the following link:

Hope this helps.

Ana Reis


Ah, that makes sense.

It's just that the documentation doesn't make that clear.

Maybe an example in the docs would help.

Hi everyone, 

i have 2 questions regarding this function

1) Does this function work for process and timers as well?

2) Referring to the documentation below, for process and timers, is it possible to connect to multiple dB connection per process or timer since each process or timer is considered 1 request/session.

  • If there is single aggregate or advanced query that uses the Database Connection with the old database before this action is executed, the switch to the new database will not happen until the end of the current request . Only in a next request the database switch becomes effective.