#50674 [Opn->Bgs]: Zend_Db SQL-Server query leaves results pending

From: Date: Tue, 05 Jan 2010 22:43:00 +0000
Subject: #50674 [Opn->Bgs]: Zend_Db SQL-Server query leaves results pending
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-146369@lists.php.net to get a copy of this message
ID: 50674 Updated by: scottmac@php.net Reported By: wayne dot dean at opticsplanet dot com -Status: Open +Status: Bogus Bug Type: PDO related Operating System: 2.6.24-24-server PHP Version: 5.3.1 New Comment: This should be reported to the Zend Framework bug tracker, this is the PHP bug tracker. Previous Comments: ------------------------------------------------------------------------ [2010-01-05 21:46:44] wayne dot dean at opticsplanet dot com Description: ------------ Zend_Db: When executing stored procedure on SQL Server from loop, subsequent queries in loop return Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 20019 Attempt to initiate a new SQL Server operation with results pending. [20019] Current workaround is to reconnect after each loop iteration, which is expensive. Reproduce code: --------------- $db = $this->getAdapter(); foreach($data as $k => $v){ $sql = "EXECUTE sp_DoSomething {$db->quote($k)}, {$db->quote($v)}"; $result = $db->query($sql)->fetchAll(); } Expected result: ---------------- Successful execution of stored procedure during each loop iteration. Actual result: -------------- First execution in loop succeeds, but subsequent executions return Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 20019 Attempt to initiate a new SQL Server operation with results pending. [20019] ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50674&edit=1

« previous php.bugs (#146369) next »