I am developing an application using Symfony 3 (php 7.1) with SQL Server database with AlwaysOn. AlwaysOn is a SQL server support for high-availability and disaster recovery, and Doctrine 2 is not working well with this paradigm.
I've developed a CRUD to test it for the infrastructure section at my job that implemented this database. At the first time, it was working correctly and persisting ok. But, when they change the instance for another one, like when happens if the first one stops working, automatically go to the other instance with the same database structure and data. When it happens I receive an error message from doctrine:
Fatal error: Invalid handle returned. in C:\xampp\htdocs\testesql\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php on line 43
It looks like Doctrine caches something that is not working with this paradigm of database. I am using Microsoft SQL Server driver (pdo_sqlsrv). Could someone help me? I would be glad.