General error: 2014 Cannot execute queries while other unbuffered queries are active

Hello !

I have this error when i want to create a new invoice. I have about more than 4 000 contacts and i have this error since yesterday :
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. (SQL: select * from contacts where contacts.client_id in …

I try to add $this->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true); on Doctrine PDOConnection.php but i have still the same error. Do you know how i can resolve this SQL problem ?

Best,

Christophe

Found a solution : use $this->setAttribute(PDO::ATTR_EMULATE_PREPARES,true);

Thanks for sharing the solution!

cc @david

1 Like