php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47898 PDO closeCursor
Submitted: 2009-04-05 10:14 UTC Modified: 2009-11-19 11:17 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: riksoft at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: riksoft at gmail dot com
New email:
PHP Version: OS:

 

 [2009-04-05 10:14 UTC] riksoft at gmail dot com
Description:
------------
From manual page: pdostatement.closecursor you can read:

"This method is useful for database drivers that do not support executing a PDOStatement object when a previously executed PDOStatement object still has unfetched rows. If your database driver suffers from this limitation, the problem may manifest itself in an out-of-sequence error."

This implicitly means that if I want to fetch 2 resultset at the same time, I must establish 2 connection. Right?

But whatever the case, since that an important resource and performance issue, should be nice to have a list of such database (those with the problem described) to make a decision on using closeCursor or cut support for those database in the project.

We need at least a basic list of most important DB: MySql, Sqlite, pgSql....



Also in page documenting PDO Query (pdo.query.php)

"If you do not fetch all of the data in a result set before issuing your next call to PDO::query(), your call may fail. Call PDOStatement::closeCursor() to release the database resources associated with the PDOStatement object before issuing your next call to PDO::query()."

Very uningegneristic statement: "your call may fail"! Where? I need to know where I can avoid because is a pretty bottleneck... if not, why it isn't enclosed by design in every execute/query?

Reproduce code:
---------------
---
From manual page: pdostatement.closecursor
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-19 11:17 UTC] vrana@php.net
It is a best practice to fetch all rows or close cursor before executing other query.

Documenting that it is not required in some drivers would be against this best practice.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 12:01:28 2025 UTC