Re: [EXTERNAL] Re: Default isolation_level for sqlite3.connect?

Hick Gunter <hick-p6o8VmWS/[email protected]>
Newsgroups gmane.comp.db.sqlite.general
Message-ID <775c82d3ceff74a9a1cb55d2388cb7b809b75a5f@localhost>
"Autocommit" means that each SQL Statement executes in it's own transaction. Just as if you were to execute "begin; <statement>; commit;" each time.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:[email protected]] Im Auftrag von Peng Yu
Gesendet: Freitag, 31. Januar 2020 02:14
An: SQLite mailing list <[email protected]>
Betreff: [EXTERNAL] Re: [sqlite] Default isolation_level for sqlite3.connect?

I still have a hard time to understand what the difference is according to the python manual. It keeps saying see somewhere else in the python manual. But I don't see where it explains the differences between the differences comprehensively and clearly.

https://www.sqlite.org/lang_transaction.html

On the above page, I only see

- BEGIN
- BEGIN DEFERRED
- BEGIN IMMEDIATE
- BEGIN EXCLUSIVE

, where BEGIN is just BEGIN DEFERRED.

But what is isolation_level = None?

https://docs.python.org/3.8/library/sqlite3.html#sqlite3-controlling-transactions

"The underlying sqlite3 library operates in autocommit mode by default, but the Python sqlite3 module by default does not."

According to the above, since isolation_level="" is the default in python, so it is not autocommit and it is BEGIN.

But what is autocommit mode? The following doesn't provide a definition. Is there a definition on sqlite.com website?

https://www.sqlite.org/c3ref/get_autocommit.html

> The default is an empty string (ie, '').  It can take the value None,
> '', 'DEFERRED', 'IMMEDIATE', 'EXCLUSIVE' and the value (if not None)
> is appended to the BEGIN when a magical transaction is started, and if
> None, then you are indicating that you will be using manual
> transaction control
>
> isolation_level   command
> None              None
> '' (default)      BEGIN
> 'DEFERRED'        BEGIN DEFERRED
> 'IMMEDIATE'       BEGIN IMMEDIATE
> 'EXCLUSIVE'       BEGIN EXCLUSIVE
>
> You can set the isolation_level in the connect call (the default is
> '') or read/change it with the .isolation_level property of a connection object.

--
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.