#47898 [Opn->WFx]: PDO closeCursor

From: Date: Thu, 19 Nov 2009 11:17:51 +0000
Subject: #47898 [Opn->WFx]: PDO closeCursor
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3231@lists.php.net to get a copy of this message
 ID:               47898
 Updated by:       vrana@php.net
 Reported By:      riksoft at gmail dot com
-Status:           Open
+Status:           Wont fix
 Bug Type:         Documentation problem
 Operating System: Windows XP
 PHP Version:      Irrelevant
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2009-04-05 10:14:54] 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
---




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47898&edit=1



Thread (2 messages)

« previous php.doc.bugs (#3231) next »