ZF2-482: Unable to iterate over a database ResultSet twice
Description
When you try to iterate over a result set a second time, you get an exception:
This result is a forward only result set, calling rewind() after moving forward is not supported' in /www/zendframework/zf2/library/Zend/Db/Adapter/Driver/Pdo/Result.php on line 149
Comments
Posted by Maks 3w (maks3w) on 2012-08-28T22:49:38.000+0000
Fixed with PR https://github.com/zendframework/zf2/pull/2247
Posted by Ricardo Maia (ricardomaia) on 2012-09-02T06:39:05.000+0000
I see the same error here. That issue persists, I believe. I got a fresh copy from Git master repository, downloaded in september 2.
I made tests with a database like this:
1;"The Tell-Tale Heart" 2;"Little Women" 3;"The Velveteen Rabbit" 4;"Goodnight Moon" 5;"Bartholomew and the Oobleck" 6;"The Cat in the Hat" 7;"Dynamic Anatomy" 8;"2001: A Space Odyssey" 9;"Dune" 10;"The Shining" 11;"Franklin in the Dark" 12;"Practical PostgreSQL" 13;"Programming Python" 14;"Learning Python" 15;"Perl Cookbook"
At the first time the key value is NULL. So, changes on keys almost working, but the values are moving forward only, aparently caused by cursor settings.
Posted by Koen Pieters (koen) on 2012-09-07T13:27:26.000+0000
I've did a try to fix this error when you use a buffer. That also still had an error in it.
You have to change your test code to:
pull request: https://github.com/zendframework/zf2/pull/2314
Posted by Ralph Schindler (ralph) on 2012-10-08T20:14:56.000+0000
This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2532