Finish Hotfix-1
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -30,7 +30,6 @@ import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.service.dto.AttachmentDTO;
|
||||
import it.integry.ems.service.dto.EntityFieldDTO;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
@@ -830,26 +829,7 @@ public class EmsServices {
|
||||
if (UtilityDebug.isDebugExecution() || UtilityDebug.isIntegryServer())
|
||||
throw new Exception("Cannot export server info in DEBUG mode");
|
||||
|
||||
|
||||
List<AvailableConnectionsModel> availableConnectionList =
|
||||
settingsModel.getAvailableConnectionsWithoutDuplicatedProfiles(true, settingsController.getHistoryProfileDb());
|
||||
|
||||
for (AvailableConnectionsModel model : availableConnectionList) {
|
||||
try {
|
||||
if (model.getInternalDb() && !model.getProfileName().equalsIgnoreCase(settingsModel.getDefaultProfile())) {
|
||||
DataSource ds = new DataSource();
|
||||
ds.initialize(model.getProfileName());
|
||||
|
||||
String sql = "SELECT db_distributore FROM azienda";
|
||||
String dbDistributore = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(ds.getConnection(), sql);
|
||||
|
||||
multiDBTransactionManager.addConnection(model.getProfileName(), ds, model.getDbName().equalsIgnoreCase(dbDistributore));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error(String.format("La connessione al DB \"%s\" non è valida. %s", model.getProfileName(), ex.getMessage()), ex);
|
||||
}
|
||||
}
|
||||
multiDBTransactionManager.setPrimaryDs(settingsModel.getDefaultProfile());
|
||||
|
||||
HashMap<String, Object> arguments = new HashMap<>();
|
||||
|
||||
@@ -911,7 +891,7 @@ public class EmsServices {
|
||||
int requestStatusCode = HttpRestWrapper.callGeneric(url, null, null, jsonBody, ContentType.APPLICATION_JSON, srb, null);
|
||||
}
|
||||
|
||||
private DatabaseEngineInfoDTO getDatabaseEngineInfo(MultiDBTransactionManager data) {
|
||||
private DatabaseEngineInfoDTO getDatabaseEngineInfo(MultiDBTransactionManager mdb) {
|
||||
DatabaseEngineInfoDTO databaseEngineInfoDTO = null;
|
||||
try {
|
||||
String dbEngineVersionSql = "SELECT product_version " +
|
||||
@@ -947,7 +927,7 @@ public class EmsServices {
|
||||
" , CAST(SERVERPROPERTY('productlevel') AS nvarchar) as product_level " +
|
||||
" , CAST(SERVERPROPERTY('edition') AS nvarchar) as edition) info";
|
||||
|
||||
HashMap<String, Object> result = UtilityDB.executeSimpleQueryOnlyFirstRow(data.getPrimaryConnection(), dbEngineVersionSql);
|
||||
HashMap<String, Object> result = UtilityDB.executeSimpleQueryOnlyFirstRow(mdb.getPrimaryConnection(), dbEngineVersionSql);
|
||||
|
||||
databaseEngineInfoDTO = new DatabaseEngineInfoDTO()
|
||||
.setProductEdition(UtilityHashMap.<String>getValueIfExists(result, "edition"))
|
||||
@@ -957,7 +937,7 @@ public class EmsServices {
|
||||
.setDatabaseInfoList(new ArrayList<>());
|
||||
|
||||
|
||||
for (AdvancedDataSource dataSource : data.getActiveConnections()) {
|
||||
for (AdvancedDataSource dataSource : mdb.getActiveConnections()) {
|
||||
String databaseInfoSql = "SELECT DB_NAME(database_id) AS database_name, Name AS logical_name," +
|
||||
" (size*8)/1024 AS size_mb, " +
|
||||
" case when max_size > 200000000 then -1 " +
|
||||
@@ -987,7 +967,7 @@ public class EmsServices {
|
||||
}
|
||||
|
||||
|
||||
private List<ApplicationInfoDTO> getApplicatinInfo(MultiDBTransactionManager data) throws Exception {
|
||||
private List<ApplicationInfoDTO> getApplicatinInfo(MultiDBTransactionManager mdb) throws Exception {
|
||||
List<ApplicationInfoDTO> applicationInfoDTOList = new ArrayList<>();
|
||||
|
||||
String sql =
|
||||
@@ -999,13 +979,8 @@ public class EmsServices {
|
||||
" FROM azienda";
|
||||
|
||||
|
||||
List<AdvancedDataSource> db =
|
||||
data.getActiveConnections().stream()
|
||||
.filter(x -> UtilityString.equalsIgnoreCase(x.getDataSource().getProfile(), x.getDataSource().getDbName()) &&
|
||||
x.isInternalDb())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (AdvancedDataSource dataSource : db) {
|
||||
for (AdvancedDataSource dataSource : mdb.getActiveConnections()) {
|
||||
HashMap<String, Object> resultDbInfo = UtilityDB.executeSimpleQueryOnlyFirstRow(dataSource.getConnection(), sql);
|
||||
|
||||
final HashMap<String, String> setupSection = setupGest.getSetupSection(multiDBTransactionManager.getPrimaryConnection(), "DATI_AZIENDA", "SETUP");
|
||||
|
||||
Reference in New Issue
Block a user