davideairaghi / php

repository of php code
Apache License 2.0
12 stars 9 forks source link

Invalid cursor state #1

Closed ruudboon closed 8 years ago

ruudboon commented 8 years ago

I tried to use MSSQL adapter but having some issues. Looks like it's related to the MARS (Multiple Active Result Sets). Can't really pinpoint the exact problem. But hopefully you have some suggestions.

SQLSTATE[24000]: Invalid cursor state: 0 [FreeTDS][SQL Server]Invalid cursor state (SQLExecute[0] at /wrkdirs/usr/ports/databases/php56-pdo_odbc/work/php-5.6.14/ext/pdo_odbc/odbc_stmt.c:254)

Using FreeTDS with odbc

davideairaghi commented 8 years ago

Hi, i developed and used the MSSQL adapter+dialect classes primarly on Windows, using the native php module build by Microsoft, i haven't tried to use it using FreeDTS+ODBC.

if you have multiple recordsets open at hte same time you could try to refactor your code in order to "consume" a recordset before creating a new one ... but without seeing the code it's really hard to help you.

ruudboon commented 8 years ago

Hi, Thnx for your fast response. I'm just doing a find on a model (MyModel::Find()) but unfortunately it looks like Phalcon relies on having multiple sets open. I already opened a ticket to see if I can turn it off. https://github.com/phalcon/cphalcon/issues/11077

ruudboon commented 8 years ago

It was related to the FreeTDS build. You must compile it with --enable-mars to make it possible to support MARS.