php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50674 Zend_Db SQL-Server query leaves results pending
Submitted: 2010-01-05 21:46 UTC Modified: 2010-01-05 22:42 UTC
From: wayne dot dean at opticsplanet dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.3.1 OS: 2.6.24-24-server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wayne dot dean at opticsplanet dot com
New email:
PHP Version: OS:

 

 [2010-01-05 21:46 UTC] 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]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-05 22:42 UTC] scottmac@php.net
This should be reported to the Zend Framework bug tracker, this is the PHP bug tracker.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 08:01:30 2024 UTC