On Apr 9, 2012, at 8:34 PM, Mitchell Hashimoto wrote: > > In addition to fetchall() there are some fetchone() calls as well. I'm > assuming in these cases I need to explicitly close the ResultProxy? >
Well yes, if you only called fetchone(), there's no indication yet that there aren't more rows available, and the ResultProxy keeps open both the cursor as well as the ultimate DBAPI connection checked out, only releasing these resources when the cursor is exhausted. It's for this reason if you have a lot of one-row results, you can use result.first() or result.scalar() which will close things out after returning the single result. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.