On 2017/09/27 8:35 AM, bensonbear wrote:
I didn't even know that outside transactions, SQLite by
default itself commits automatically after each statement,
which I would not have wanted.  However, the  python
module by default implicitly inserts "begin"s so that
statements are grouped into a transaction that one then has to
explicitly commit  Thus, that the commit I did after them was necessary
for that reason, and not the reason I assumed, which was that
SQLite itself needed the commit even outside transactions.

You already seem to have found the correct behaviour, but just to be clear: It's not that SQLite commits after every statement - In SQLite, unless you have explicitly opened a transaction (using BEGIN), every statement is (and must be) in and of itself a transaction. I imagine this is needed to ensure Atomicity in a DB where locking is dependent on an external mechanism (File system in this case).  I could be wrong about the reason, but the behaviour remains.

Glad you figured out the culprit!
Cheers,
Ryan


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to