I guess I am a bit confused.  Igor says it's not possible, but Roger
says my example works.

One other point of confusion is that sometimes an interface layer will
grab all or a bunch of the rows after a select, even though it may
hand them to upper layers one row at a time.  For example, with
pysqlite, cur.fetchmany() does this.  When this happens, it appears as
if the transaction & commit occur, but the select & fetch loop have
already finished behind the scenes.

For my particular app, I'm only adding new rows, so there wouldn't be
too many weird effects.

Jim

On 6/30/09, Roger Binns <rog...@rogerbinns.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jim Wilcoxson wrote:
>> With the Python bindings, an error occurs
>> because a commit resets all pending select statements.
>
> Note that there are some constraints about how SQLite works detailed by
> Igor, but in this particular case you are being stymied by pysqlite.
>
> By default pysqlite tries to parse the SQL you execute and does
> transaction management behind the scenes on your behalf (ie calling
> begin and commit as it deems fit).  This is allegedly something required
> by the Python DBAPI standard although I admit I don't understand it
> myself.  Apparently you use the isolation level parameter with pysqlite
> to control how much of this nonsense it does behind the scenes.
>
> If you use apsw (disclaimer: I am the author) then it doesn't do any
> nonsense behind your back and you get (1,) (2,) (3,) printed out twice
> without any exceptions as you were expecting.
>
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkpKZKgACgkQmOOfHg372QSMJwCgkIoZ8VGqUcpn8rMtZPF7kpoF
> vqIAnj5qIaSCy7VTp5mJsAQ4mBVCk+GD
> =SGGD
> -----END PGP SIGNATURE-----
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Software first.  Software lasts!
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to