Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.0.3
-
Fix Version/s: None
-
Component/s: Zend_Db
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
You should call close() method before reference has gone if you use Zend_Db_Statement_Mysqli statement.
This should be noted on it.
http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.adapter-notes
If you do not call, you may receive a message at next use of the database.
The message is "Commands out of sync; You can't run this command now".
This will cause a problem you hard to find out.
The destructor check could avoid the issue.
The Statement sample something like this.
$statement = $select->query(); try { $data = $statement->fetchAll(); // ... if (method_exists($statement, 'close')) { $statement->close(); } } catch (Exception $e) { try { // Mysqli if (method_exists($statement, 'close')) { $statement->close(); } } catch (Exception $e) { // ignore close error } throw $e; }
Please categorize/fix as needed.