[pysqlite] [APSW] "SQLError: cannot rollback - no transaction is active"

Fred <[email protected]> Sun, 07 Dec 2008 18:53:16 +0100
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
From: Roger Binns > You can delete the "try" and remove the whole 
"except" section.  Python exits on unhandled exceptions anyway, and 
the automatic cleanups will end up doing the rollback anyway.

Thanks much for the tip.

>That makes no sense whatsoever!  You are certainly worse at SQL 
>parsing than the computer.  If you use bindings you can be 
>absolutely sure of what is going in.  I also fail to see why they 
>can't be printed.  If the
>execute looks like this:
>
>   sql="... some sql ..."
>   bindings=[1,"two"]
>   cursor.execute(sql, bindings)
>
>Then this works:
>
>   print sql, bindings

Thanks again. If I can print the resulting SQL even when using 
bindings, I'll get into the habit of using this structure instead.