Commit 5cc2f462 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ecriture d'un refresh des indicateurs (drop et create)

parent 33b6a8b2
Loading
Loading
Loading
Loading
Loading
+11 −9
Changes for module/Indicateur/src/Indicateur/Service/IndicateurService.php: 11 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -136,15 +136,17 @@ class IndicateurService {
     */
    public function refreshMaterializedView($indicateur) {

        $SQL  = "BEGIN ";
        $SQL .= "   DBMS_MVIEW.REFRESH('MV_INDICATEUR_1', 'C'); ";
        $SQL .= "END";
        try {
            $stmt = $this->entityManager->getConnection()->prepare($SQL);
        } catch (DBALException $e) {
            throw new RuntimeException("Un problème s'est produit lors du rafraichissement de la vue matérialisée.");
        }
        $stmt->execute(null);
//        $SQL  = "BEGIN ";
//        $SQL .= "   DBMS_MVIEW.REFRESH('MV_INDICATEUR_1', 'C'); ";
//        $SQL .= "END";
//        try {
//            $stmt = $this->entityManager->getConnection()->prepare($SQL);
//        } catch (DBALException $e) {
//            throw new RuntimeException("Un problème s'est produit lors du rafraichissement de la vue matérialisée.");
//        }
//        $stmt->execute(null);
        $this->dropMaterialzedView($indicateur);
        $this->createMaterialzedView($indicateur);
    }

    /**