On Tue, Sep 25, 2012 at 7:57 PM, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Tue, Sep 25, 2012 at 11:24 PM, maxi <maxiroba...@gmail.com> wrote: >> No, I just answer because it caught my attention. Why not just trust in a >> True/False property ? > > As I recall, the reason we can't just use a property is MySQL. There's > no reliable way to tell whether the database has been set up as > InnoDB, which supports transactions, or MyISAM, which doesn't. An > experimental approach allows us to be certain.
Actually, there are several database engines in MySQL that support transactions, not just InnoDB, though that's the most popular. >> BTW, What do you mean with "commit/rollback/etc are simply no-ops" ? > > Exactly that. On databases that don't support transactions, > commit/rollback etc are no-ops. Not exactly. MySQLdb starts in transactional mode (required by PEP-249), but if for some reason it's switched to autocommit mode, rollback throws an exception. There's probably nothing in Django that would set the connection to autocommit mode, though. Additionally, MySQL (at least as of 5.0) will throw a warning ("Some non-transactional changed tables couldn't be rolled back") if you do try rollback on non-transactional tables If you run your MySQL session in ANSI mode, this becomes an error and will produce an exception in MySQLdb. http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html I've kicked around the idea of making a mysql_ansi database driver for Django but there hasn't been a compelling reason to do it. -- Question the answers -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.