MySQL stored procedures with PDO on Windows

I have mixed feelings when it comes to stored procedures. On one side, they pull away a part of your applications logic which decreases maintainability. While on the other side they tend to perform better and are easily accessible (for instance, by a DBA).

Anyway, there are certainly situations were I use them and while doing so on MySQL I bumped into this bug report (and this related one). One stored procedure call did not produce any errors but when I added a second, PDO threw “General error: 2014 Cannot execute queries while other unbuffered queries are active.”.

Apparently using PDO to call multiple MySQL stored procedures on a Windows environment (e.g. your development WampServer) causes a few errors (different ones depending on the amount of calls if I’m correct). After 2 years it should have been fixed mid September ‘08 so hopefully the next PHP release will correct this.

In case you ever wondered: this seems to be a reason why the popular e-commerce solution Magento currently requires a linux server.