Question about DatabaseConnection_SetConnectionStringForSession action?
Application Type
Traditional Web


The DatabaseConnection_SetConnectionStringForSession action  allow you change database connection string dynamicly.

I want to chage the connection string for some special users. It works, But when I longin with normal user and don't call the function it seems the connection string is not change back to default settion in the Db Conntion.

Is this normal behavior, Do I need to use DatabaseConnection_SetConnectionStringForSession even I don't want to change Connection String.

Kind Regards,

By default, the connection configured in Service Center will be used. When you want to switch to another connection, you can use the component DatabaseConnection_SetConnectionStringForSession. Hope you know the prerequisites (like using same database/schema).

When you want to change the connection string for special users, you can check for the roles in preparation and change the connection for them alone before the execution of aggregates. It should connect to the configured database if the user is not a special user.

I used the component in traditional web application where a timer connects to 5 different DC (Delivery Center) and does table cleaning operation. We defined only one connection and single timer which is triggered again until all the 5 DC data are cleaned. The same timer is triggered again and again and for each trigger, it would connect to different DC.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.