Jim Jewett added the comment: On Jun 14, 2014 4:05 AM, "Aymeric Augustin"
> preserving the same behavior by default That is a requirement, because of backwards compatibility. > providing more control for users who need a different behavior, for instance people who use SQLite as an application file format or as a web application storage backend. Great ... but make sure it is also simpler. It is already *possible* to do what you want with 3rd party code. So if doing it "right" would still require an arcane recipe, that isn't a gain. At a minimum, the new docs should explain why the current default is not sufficient for an application file or a Web backend, and what to do instead. New code is only justified if it makes the "do this instead" simpler and more obvious. My personal opinion is still that adding more keywords won't do this, because the old ones will still be there to confuse ... thus my suggestion of a new function. > > When starting with Python I always thought that code like this is harmles: > > >>> conn = sqlite3.connect("test.db") > >>> data = list(conn.execute("select * from mytable")) > > > Currently it is, but only because sqlite3 module parses the select as DQL and does not lock the database. > > It will absolutely remain harmless with my proposal, if you don't change your code. > > However, for that use case I would like to encourage the use of autocommit mode. That's really the semantics you want here. I should NOT need to mess with anything related to "commit" if I am just selecting. If that means another new function for lockless/read-only/uncommitted-read connections, then so be it. > My take is to avoid the problem entirely, and not inflict it to new users, by providing an option to start in autocommit mode and then create transactions only when you want them. But again, if it requires choosing a commit mode for my selects, then it fails to be simple. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10740> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com