The default case is for unknown or unsupported fetch modes. This
throws an exception.
It's good to close the cursor before throwing an exception, because
it's likely that the statement will be aborted and without closing a
cursor, statement handles accumulate in the DB server and cause a
garbage collection problem.
Setting a valid fetch mode should not close the cursor, it only
changes the fetch mode for subsequent fetches. I.e. you can (in
theory) change the fetch mode several times as you fetch rows from the
same result set.
Regards,
Bill Karwin
On May 25, 2010, at 10:57 AM, Саша Стаменковић wrote:
Zend_Db_Statement in setFetchMode() calls $this->closeCursor(); only
in default case for $mode, why not in other cases?!