I have a long-running process, a symfony command that uses ReactPhp behind and lasts running for hours.
If the DBAL $connection is not used, it breaks and the next time a request enters and is processed, it throws an exception.
I am wondering if that is not recoverable or doctrine provides a mechanism to "refresh" the connection (some sort of keepalive).
I've run both
php bin/console debug:config doctrine
php bin/console config:dump-reference doctrine
and I had no luck.
Question
Can I add some sort of "keep-alive" directive to send some sort of dummy SELECT 1 every 5 mins to avoid the connection breaking?
you just need to test and reopen your connection.
this is also usefull if you have an SQL error which closes the manager.