Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71009

Re: Problems with ZODB, I can not persist and object accessed from 2 threads

From dieter <dieter@handshake.de>
Subject Re: Problems with ZODB, I can not persist and object accessed from 2 threads
Date 2014-05-07 08:48 +0200
References <CAMxmM6boETC3DoB+1-Eeg+6O8ebcrwt1Mz4fYbrua_3kSYttVg@mail.gmail.com> <87iopjyxsj.fsf@handshake.de> <a9tim9t9o9cvhvd30tbhl41iflsfn4pm4u@4ax.com>
Newsgroups comp.lang.python
Message-ID <mailman.9726.1399445324.18130.python-list@python.org> (permalink)

Show all headers | View raw


Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:

> On Tue, 06 May 2014 13:03:08 +0200, dieter <dieter@handshake.de> declaimed
> the following:
>
>>
>>The database (we have called it "db") is global to all threads.
>>Each thread must open (and maybe close) its own connection to the
>>global database. You must never share the same connection or
>>objects loaded via the connection between threads - very weird
>>(and apparently non-deterministic) errors can result.
>>
> 	Actually, one should study the documentation for the dbapi adapter
> being used -- some may allow the connection (db = adapter.connect(...)) to
> be shared by threads, but require each thread to create its own cursor (cur
> = db.cursor())

We are speaking here about the ZODB (= "Zope Object DataBase").
This is not a relational database - and does not have cursors
(just databases, transactions and connections).

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Problems with ZODB, I can not persist and object accessed from 2 threads dieter <dieter@handshake.de> - 2014-05-07 08:48 +0200

csiph-web