Loading src/UnicaenDbImport/Service/SynchroService.php +10 −1 Original line number Diff line number Diff line <?php namespace UnicaenDbImport\Service; use Exception; use UnicaenApp\Exception\RuntimeException; use UnicaenDbImport\Config\Config; use UnicaenDbImport\Domain\Exception\NotFoundException; use UnicaenDbImport\Domain\ImportInterface; Loading Loading @@ -90,6 +90,7 @@ class SynchroService { $source = $synchro->getSource(); $destination = $synchro->getDestination(); $connection = $destination->getConnection(); $result = new SynchroResult(); $result->setSynchro($synchro); Loading @@ -106,7 +107,15 @@ class SynchroService $this->facadeService->validateDestination(); $this->facadeService->validateSource(); $this->facadeService->discoverSourceColumns(); $connection->beginTransaction(); try { $diffViewRequestResult = $this->facadeService->synchronizeDestination(); $connection->commit(); } catch (Exception $e) { $connection->rollBack(); throw new RuntimeException("Erreur rencontrée. Rollback effectué.", null, $e); } $result->setDiffViewRequestResult($diffViewRequestResult); Loading Loading
src/UnicaenDbImport/Service/SynchroService.php +10 −1 Original line number Diff line number Diff line <?php namespace UnicaenDbImport\Service; use Exception; use UnicaenApp\Exception\RuntimeException; use UnicaenDbImport\Config\Config; use UnicaenDbImport\Domain\Exception\NotFoundException; use UnicaenDbImport\Domain\ImportInterface; Loading Loading @@ -90,6 +90,7 @@ class SynchroService { $source = $synchro->getSource(); $destination = $synchro->getDestination(); $connection = $destination->getConnection(); $result = new SynchroResult(); $result->setSynchro($synchro); Loading @@ -106,7 +107,15 @@ class SynchroService $this->facadeService->validateDestination(); $this->facadeService->validateSource(); $this->facadeService->discoverSourceColumns(); $connection->beginTransaction(); try { $diffViewRequestResult = $this->facadeService->synchronizeDestination(); $connection->commit(); } catch (Exception $e) { $connection->rollBack(); throw new RuntimeException("Erreur rencontrée. Rollback effectué.", null, $e); } $result->setDiffViewRequestResult($diffViewRequestResult); Loading