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


Groups > comp.lang.python > #71009 > unrolled thread

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

Started bydieter <dieter@handshake.de>
First post2014-05-07 08:48 +0200
Last post2014-05-07 08:48 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

Fromdieter <dieter@handshake.de>
Date2014-05-07 08:48 +0200
SubjectRe: Problems with ZODB, I can not persist and object accessed from 2 threads
Message-ID<mailman.9726.1399445324.18130.python-list@python.org>
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).

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web