Re: [pysqlite] [ANN] pysqlite 2.5.2

Gerhard Häring <[email protected]> Thu, 05 Mar 2009 08:55:11 +0100
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Edzard Pasma wrote:
> Hello,
> 
> It looks that the issue with fetch across rollback still can occur in the new version. It turned up when I applied the Pysqlite transaction test suite to some dbapi2 version of my own. Below is a minimal script to reproduce it. It has puzzled me what goes wrong and I would like to believe that the old version is still installed. But the printed version is the new one. Also it behavious slightly different, as the same result comes also after commit. In 2.5.1 you would not get that far. The issue is not causing practical problems but it would be nice to have a work-around to get a clean test result.
> It is great, by the way, that commit and rollback are now dealing equally with open cursors! 
> 
> [...]
> class Connection (sqlite.Connection):
>     def cursor (self):
>         return Cursor (self)

Here's the problem. do this instead:

return sqlite.Connection.cursor(self)

and it will work as designed.

I'll open a ticket. Eventually, this restriction needs to be documented
or fixed.

Basically, constructing Connection and Cursor objects directly instead
of via dbapi2.connect or Connection.cursor was no intended use, thus not
tested, thus buggy ;-)

-- Gerhard