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

dieter dieter at handshake.de
Wed May 7 02:48:29 EDT 2014


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

> On Tue, 06 May 2014 13:03:08 +0200, dieter <dieter at 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).




More information about the Python-list mailing list