Friday, August 8, 2014

Re: Cake 2.5.1 Extremely Slow With MSSQL?

Hi Jordan,

I am having the same issue (cakephp 2.5.3, sql server 2008 r2) and I was able to fix it by overriding the SqlServer driver and changing the following line (line number 772)

$prepareOptions += array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL);

to

$prepareOptions += array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY);

inside of the _execute function

Let me know if this solves your issue.


On Wednesday, May 28, 2014 5:19:09 PM UTC-4, Jordan Hopfner wrote:
Hey guys,

I'm using the latest version of Cake (2.5.1) and am having a problem with extremely slow connections to a MSSQL server. A controller action that only has one simple select statement is taking an upwards of 50 seconds to complete. I don't think it's the select statement itself, I have a created an empty page that connects to MSSQL via PDO and executes the exact same statement and the result is instantaneous, so this leads me to believe it's a problem with the MSSQL data source packaged with Cake. If it was a driver or connection issue I would assume it would happen on the test page as well. Any ideas? I'm on PHP 5.3.x and am connecting to SQL Server 2008 R2.

Jordan

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: