Forum Discussion

yulione's avatar
yulione
Frequent Visitor
1 year ago
Solved

Query Microsoft Fabrics Warehouse using PHP / Doctrine DBAL

My company is moving all our data to Microsoft Fabrics, which is great, however we have some PHP app who needs to access those datas. All those apps are using Doctrine DBAL, and we can't find how to...
  • yulione's avatar
    1 year ago

    Hey again. 

     

    After several weeks of discussion with Microsoft, it appear that this is because Warehouse doesn't support Multiple Active Result Sets (MARS). Setting MultipleActiveResultSets=0 in option resolve the problem. 

     

    so, the final method for me was :  

     

            $connectionParams = [
                'dbname' => 'my_DBname',
                'user' => [email protected]',
                'password' => 'mypassword',
                'host' => 'xxxxxxxxxxxxxx.datawarehouse.fabric.microsoft.com',
                'driver' => 'pdo_sqlsrv',
                'port' => 1433,
                'driverOptions' => [
                    'Authentication' => 'ActiveDirectoryPassword',
                    'MultipleActiveResultSets' => 0,
                    'Encrypt' => 1,
                    'TrustServerCertificate' => true
                ]
            ];
            $this->conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);