SQLObject transaction rollback not working

Magnus Lycka lycka at carmen.se
Mon Dec 5 12:28:54 EST 2005


jacob.miles at gmail.com wrote:
> Does anyone see what I'm doing wrong?

Using MySQL? Are you aware that MySQL doesn't support transaction
handling with COMMIT and ROLLBACK in all configurations. It depends
on your MySQL version and what table backend you are using.

The Python DB-API states that autocommit should be turned off by
default, so if your tables support that, it should work right in
MySQLdb. SQLObject on the other hand, turns autocommit on by
default, so that could be the cuplrit if the problem is that you
didn't read the SQLObject docs... ;)

See
http://www.sqlobject.org/SQLObject.html#declaring-the-class
"Parameters are: debug (default: False), debugOutput (default: False), 
cache (default: True), autoCommit (default: True), debugThreading 
(default: False)."

You might need to turn off both cache and autocommit to get things
to work right.



More information about the Python-list mailing list