Merge branch 'master' into develop
Some checks failed
IntegryManagementSystem_Multi/pipeline/head Something is wrong with the build of this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@@ -131,7 +131,6 @@ public class ExchangeColliImportService {
|
||||
final Exception[] firstExceptionToThrow = {null};
|
||||
|
||||
|
||||
|
||||
while (startDate.minusDays(1).isBefore(UtilityLocalDate.getNow())) {
|
||||
|
||||
final LocalDate tempStartDate = startDate;
|
||||
@@ -202,6 +201,10 @@ public class ExchangeColliImportService {
|
||||
internalMultiDbThread.commitAll();
|
||||
exchangeMultiDbThread.commitAll();
|
||||
} catch (Exception ex) {
|
||||
|
||||
internalMultiDb.rollbackAll();
|
||||
exchangeMultiDb.rollbackAll();
|
||||
|
||||
MtbColt collo = (MtbColt) dataToSave;
|
||||
Exception newException = new EntityException("Errore durante l'importazione del collo di " + finalLogType +
|
||||
" [num: " + collo.getNumCollo() + ", " +
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.ems.system.exchange.service;
|
||||
|
||||
import it.integry.ems.dto.Result;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
@@ -10,6 +9,7 @@ import it.integry.ems.system.exchange.service.structure.ExchangeImportSchemaMana
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import it.integry.ems_model.entity.DtbDocr;
|
||||
import it.integry.ems_model.entity.DtbDoct;
|
||||
import it.integry.ems_model.exception.EntityException;
|
||||
import it.integry.ems_model.exception.MergeEntityDBToObjectException;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
@@ -105,7 +105,7 @@ public class ExchangeDocumentImportService {
|
||||
AtomicInteger importedCounter = new AtomicInteger(0);
|
||||
|
||||
LocalDate startDate = LocalDate.of(2024, 7, 1);
|
||||
Result<DtbDoct> firstErrorObjectIfPresent = null;
|
||||
final Exception[] firstExceptionToThrow = {null};
|
||||
|
||||
while (startDate.minusDays(1).isBefore(UtilityLocalDate.getNow())) {
|
||||
|
||||
@@ -169,11 +169,7 @@ public class ExchangeDocumentImportService {
|
||||
internalMultiDb.commitAll();
|
||||
exchangeMultiDb.commitAll();
|
||||
} catch (Exception ex) {
|
||||
|
||||
|
||||
if (firstErrorObjectIfPresent == null) firstErrorObjectIfPresent = new Result.Error<>(ex);
|
||||
|
||||
logger.error("Errore durante l'importazione del documento di " + logType + " [" +
|
||||
Exception newException = new EntityException("Errore durante l'importazione del documento di " + logType + " [" +
|
||||
"num: " + document.getNumDoc() + ", " +
|
||||
"serie: " + document.getSerDoc() + ", " +
|
||||
"data: " + document.getDataDoc() + ", " +
|
||||
@@ -182,13 +178,16 @@ public class ExchangeDocumentImportService {
|
||||
|
||||
internalMultiDb.rollbackAll();
|
||||
exchangeMultiDb.rollbackAll();
|
||||
|
||||
if (firstExceptionToThrow[0] == null) firstExceptionToThrow[0] = newException;
|
||||
logger.error(newException);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (firstErrorObjectIfPresent != null) throw ((Result.Error) firstErrorObjectIfPresent).getError();
|
||||
if (firstExceptionToThrow[0] != null) throw firstExceptionToThrow[0];
|
||||
} finally {
|
||||
if (useTempTable)
|
||||
exchangeImportSchemaManagerService.deleteTempTables(exchangeMultiDb.getPrimaryConnection(), schemaType);
|
||||
|
||||
Reference in New Issue
Block a user