psycopg/psycopg2 — pull request #7 by snaury (2013-07-09 19:51:11+00:00)
Title: No implicit transactions for named with hold cursors outside their transaction

Hi,

I noticed that currently named "with hold" cursors behave differently than client-side cursors in some aspects, which seem to be a little off:

- When closing withhold cursor after its creating transaction is committed another transaction is implicitly started, which may unexpectedly leave connection is a long transaction
- When fetching data outside their transactions, again, an implicit transaction is started, when it seems it's not needed. Current documentation (http://www.postgresql.org/docs/current/static/sql-declare.html) currently says that it copies rows to temporary file/memory, and it seems to me (though I'm not entirely certain) that fetch would return data as it was in a transaction where cursor was created, not how it is in another transaction.

What do you think? Should implicit transactions always be created, or is it better to fetch/close in basically autocommit mode?