Commit b8ce9a6d authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction pour activer l'inscription automatique du listener OracleSessionInit

parent 2ceb3a7e
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

namespace Application;

use Doctrine\DBAL\Event\Listeners\OracleSessionInit;

return [
    /**
     * Configuration Doctrine minimum requise.
@@ -30,7 +32,15 @@ return [
                    'password' => '???',
                    'dbname'   => '???',
                    'charset'  => 'AL32UTF8',
                ]
                ],
                'eventmanager' => 'orm_sifac',
            ],
        ],
        'eventmanager'  => [
            'orm_sifac' => [
                'subscribers' => [
                    OracleSessionInit::class,
                ],
            ],
        ],
    ],
+2 −15
Original line number Diff line number Diff line
@@ -182,21 +182,8 @@ class DatabaseFacade

        $selectSql = $this->codeGenerator->generateSQLForSelectFromSource($source);

        //
        // Inscription manuelle du listener OracleSessionInit.
        // TODO: trouver pourquoi l'inscription automatique ne fonctionne pas.
        //
        try {
            $sourcePlatform = $source->getConnection()->getDatabasePlatform();
        } catch (DBALException $e) {
            throw new RuntimeException("Impossible de déterminer le type de SGBD", null, $e);
        }
        if ($sourcePlatform instanceof OraclePlatform) {
            $a = $source->getConnection();
            $a->getEventManager()->addEventSubscriber(new OracleSessionInit());
            $result = $this->queryExecutor->fetchAll($selectSql, $a);
        }
        //
        // select from source
        $result = $this->queryExecutor->fetchAll($selectSql, $source->getConnection());

        $insertsSQL = '';
        foreach ($result as $row) {