Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81696
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Db transactions and locking |
| Date | 2014-11-28 12:28 -0500 |
| Organization | IISS Elusive Unicorn |
| References | <m56u4s$baa$1@ger.gmane.org> <4loe7at2ls7tfq0oe041ru9svvsm8aksik@4ax.com> <m5924d$nbq$1@ger.gmane.org> <m596c2$jpd$1@ger.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16413.1417195728.18130.python-list@python.org> (permalink) |
On Fri, 28 Nov 2014 08:57:07 +0200, "Frank Millman" <frank@chagford.com>
declaimed the following:
>
>My guess now is that the connection is in one of two states - a transaction
>is active, or it is not. If a command is issued, and a transaction is not
>active, then a transaction is started. If a conn.commit() or a
>conn.rollback() is issued, the command is passed up to the database, and the
>connection state is reset to not active.
>
Though you may find some adapters have fits working the DB-API
preferences into the engines preference...
I think SQLite3 is one of those -- given its multilayer locking scheme
it prefers to treat pure SELECT operations as "outside of transaction",
starting a transaction on UPDATE/INSERT/DELETE operations. An adapter to a
different engine might start a transaction on the first SELECT.
Which is why I tend to stuff in con.commit() calls anywhere that there
may be a gap of time between even two SELECT operations -- ensures nothing
might block another task from accessing the database.
{BTW: my earlier comment was not about the behavior seen, but about the
statement of not seeing anything about it in the documentation}
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Db transactions and locking Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-28 12:28 -0500
csiph-web