- Fri Sep 20, 2019 5:36 am
#826597
Hi everyone.
We currently have two database (DB) connections set up in ProcessMaker.
1. MSSQL : Database from an external software solution
2. MySQL : Duplication of the first Database on the same machine as ProcessMaker.
The system administrator set it up to have the data from the first DB duplicated to the second DB. This was because the first DB was regularly down due to circumstances out of our control.
This allowed ProcessMaker to continue pulling information as it was still available in the PHP Triggers (Simple select statements usually).
The issue with this is that the second DB is not always as up to date as the first DB. Either due to speed of the duplication tool or its failure.
Is there a simple way to have ProcessMaker in a PHP trigger check in the if the first DB connection is up and if so run the MSSQL query. Else use the second connection along with the MySQL query.
Something along the lines of :
Any assistance would be greatly appreciated
We currently have two database (DB) connections set up in ProcessMaker.
1. MSSQL : Database from an external software solution
2. MySQL : Duplication of the first Database on the same machine as ProcessMaker.
The system administrator set it up to have the data from the first DB duplicated to the second DB. This was because the first DB was regularly down due to circumstances out of our control.
This allowed ProcessMaker to continue pulling information as it was still available in the PHP Triggers (Simple select statements usually).
The issue with this is that the second DB is not always as up to date as the first DB. Either due to speed of the duplication tool or its failure.
Is there a simple way to have ProcessMaker in a PHP trigger check in the if the first DB connection is up and if so run the MSSQL query. Else use the second connection along with the MySQL query.
Something along the lines of :
Code: Select all
@@db_1 = '11111111101234567890123456789012';
@@db_2 = '22222222201234567890123456789012';
if (@@db_1 can connect){
$result = executeQuery($mssql_query, @@db_1);
}else if (@@db_2 can connect){
$result = executeQuery($mysql_query, @@db_1);
}
Any assistance would be greatly appreciated