You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
collection1 = db(db.table1.id > 0).iterselect(...)
collection2 = db(db.table2.id > 0).iterselect(...)
for row in collection1:
do_something()
for row in collection2:
do_something() # breaks
Root cause:
When the iterselect (IterRows) object is initialized, it is given a gluon.contrib.pg8000.core.Cursor attribute on iter_rows._c. At the same time, the attribute iter_rows.db._adapter is given the same Cursor.
However, since db._adapter only keeps track of the latest Cursor, after the iteration of collection1, the Cursor of db._adapter is closed - then collection2 has no cursor anymore, and cannot execute the query.
The text was updated successfully, but these errors were encountered:
Minimal example:
Root cause:
When the
iterselect
(IterRows
) object is initialized, it is given agluon.contrib.pg8000.core.Cursor
attribute oniter_rows._c
. At the same time, the attributeiter_rows.db._adapter
is given the sameCursor
.However, since
db._adapter
only keeps track of the latestCursor
, after the iteration ofcollection1
, the Cursor ofdb._adapter
is closed - thencollection2
has no cursor anymore, and cannot execute the query.The text was updated successfully, but these errors were encountered: