Author aymeric.augustin
Recipients Jeremy Banks, Mark.Bucciarelli, Ronny.Pfannschmidt, adamtj, asvetlov, aymeric.augustin, dholth, ghaering, monsanto, r.david.murray, scott.urban, torsten, tshepang, zzzeek
Date 2014-04-17.19:15:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hey -- maintainer of Django's transaction support here.

This ticket was brought to my attention again today. As I know a few things about this issue and I see Python core devs asking for input, I'll give my $0.02.

The core of this issue is that, **by default**, the sqlite3 module performs a simplistic parsing of SQL queries and decides to commit before anything it doesn't understand, for example "SAVEPOINT foo".

I don't think it's a good idea to change sqlite's default operation mode to autocommit. PEP 249's prescription for transaction management aren't practical (and Django enforces the opposite behavior by default) but that's beyond the point. It's way too much backwards incompatible.

However, I don't think it's a good idea either to automatically send a COMMIT when I want to make a SAVEPOINT. In fact, if you want to use transactions with sqlite, connection.isolation_level = None is almost warranted -- and then you do everything manually.

For a slightly longer explanation, see

I've struggled mightily with all this when rewriting Django's transaction management. See:


I have implemented the workarounds I need and I we won't be able to remove them from Django anytime soon. As a consequence, I have little interest in getting this fixed.

Still, it would be sane to stop committing before savepoints by default -- that kinda ruins the concept of savepoints :-) It would be even saner to stop parsing SQL. Does look like an adequate parser for

Unfortunately, I don't have backwards-compatible proposal to fix this. Trying to account for a bit more syntax will help in the short term but not fix the underlying issue.

PS: I find it unfair to brand SQLite as a neutered database engine. Its transaction model is vastly superior to, say, MySQL. Too bad sqlite3 ruins it.
Date User Action Args
2014-04-17 19:15:50aymeric.augustinsetrecipients: + aymeric.augustin, ghaering, Jeremy Banks, r.david.murray, zzzeek, asvetlov, adamtj, dholth, torsten, monsanto, scott.urban, tshepang, Ronny.Pfannschmidt, Mark.Bucciarelli
2014-04-17 19:15:50aymeric.augustinsetmessageid: <>
2014-04-17 19:15:50aymeric.augustinlinkissue10740 messages
2014-04-17 19:15:49aymeric.augustincreate