I am working on a legacy system with Symfony 2 where I am fetching about 60k documents from an Oracle database with the following code block:
$rows = $query->fetchAll(\PDO::FETCH_ASSOC);
The problem is that I am getting the following error:
PHP Fatal error: Maximum execution time of 60 seconds exceeded in ...\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\OCI8\OCI8Statement.php on line 216
The problem is that I can't find any documentation on how I could extend the runtime. I found the parameter oci_set_call_timeout but I don't know how to configure it from Symfony. Also, I extended the PHP execution timeout as indicated by this answer just to rule it out, since I am certain that it is a DB timeout, and didn't work either.
I have also tried doing:
while($row = $query->fetch()) {}
But it also throws me timeout. If I narrow the query it works, the problem is that it is a function called in many, many places with dynamic queries, so changing SQL queries is not an option. I can think of two workable solutions:
- Extend the timeout
- Find a way to reset that timeout so that I can execute the
while($row = $query->fetch()) {}
statement without problems.
Neither of the two ways I found by looking in the official documentation or on the internet. If someone could shed some light on the subject I would appreciate it.