BUG FOUND: "DatabaseConnection_SetConnectionStringForSession" broken for MySQL server

BUG FOUND: "DatabaseConnection_SetConnectionStringForSession" broken for MySQL server

When using the following action to switch between MySQL server database it fails.

DatabaseConnection_SetConnectionStringForSession (PlatformRuntime_API)

No database is switched, when using MySQL Server, it seems like this feature has not been implemented.

I am still waiting for a bug fix, there is no workaround solution for this bug!

This issue was first reported in September
[ServiceCenter] Database connection - programmatically switch database connections?

[MySQL Server Database] Switching database at runtime - the broken feature!
Hi Robert,

Can't you directly ask support? Or don't you have a support contract?

Outsystems is aware of the issue, just waiting for a status update :)
Hey Robert,

In the future, please open a ticket with support. Specifically about this issue, we are aware of it and as I told you before, the issue was added to our backlog and we will address it accordingly to its priority. However, this is not a high priority issue so I can't tell you exactly when it is going to be fixed.

From what I undertood from your responses here you were able to switch the database in runtime and your issue was regarding the entities import, right?

Thank you,


No, DatabaseConnection_SetConnectionStringForSession does not work for MySQL.

When the issue was reported to Outsystems technical support, they were unable to reproduce the issue, and indicated  DatabaseConnection_SetConnectionStringForSession is functional - You have also tested it and reported the same.

Are you switching database running on two different servers? (same database name, same database table, two different servers)

I would like to switch two databases running on the server (two databases with different names, running on the same server)

Here is my connection string Server=10.1.x.x;Database=tempdatabase;Uid=root;Pwd=myp@ssw0rd;

Note: The original name of the database as configured in "ServerCenter" is "Platform" where as the database im switching to is "tempdatabase"


I found the issue! and it works!
When an external database is imported via integration studio,  the tables are named: `databaseschema`.`table` (i.e `platform`.`user`) but really we want the tables `table` (i.e `user`)
So I opened up my extension, removed the database/schema name from the tablename and I was able to switch database (i.e Changed from  `platform`.`user` to  `user`
See screenshot https://goo.gl/sPu87i
Note: I can not start manually modify each and every table/view name imported for hundreds of tables in this way! I need an option available via integration studio - import wizard to omit the database/schema name from the table/view name. OR modify the "DatabaseConnection_SetConnectionStringForSession" method to switch database schema! (this will create issues where an extension has been imported database with various schemas)

Now we know that DatabaseConnection_SetConnectionStringForSession method will not switch a database schema if the extension entity contains a databaseschema, it should switch in either case but it does not!

I found that every imported databases contained a database schema in the table/view name, therefore this means we can not use the DatabaseConnection_SetConnectionStringForSession method without manually modifying the every entity imported table or view (ALOT of work, not practical)
Hey Robert,

That was the conclusion from this topic :) I know that reimport tables is something that is frequent for you and we will address that issue. However, as I mentioned in the previous post, we will address it accordingly to its priority and I can't tell you exactly when it is going to be fixed.

Thank you for your feedback,

Lara ah thanks for the reminder, so basically I tested the same thing twice and twice ended up with the same conclusion. we only work with external databases therefore we use the import feature alot!. Would you have a rough idea when it would be fixed within weeks? months? years? if it's many years away would it be possible for me to obtain the source code rather than be forever stuck? I could fix this issue myself! (without much or any help) if it's not important I wouldn't bother with it, but it is important.
Hey Robert,

Please follow up this issue with OutSystems Support.