[Zope] Confusion about thread safety

Gérard Oogle g.oogle at free.fr
Sat Aug 30 11:25:23 EDT 2003


andre wrote:

> Hi,
>
> after reading several things about thread safety, i'm a little bit
> confused by the fact that the words threads and connection are used in
> too various contexts.
>
> So i'll ask a simple question.
>
> With a basic Zope server, without any other DB, what happens when two
> different users want to commit changes made to the same object at the
> same time ?
>
> are the two requests, two different threads ? ZODB speaking. 

Hi André,


I am a Zope newbie -big time- but I tend to think that asked with the
word 'thread', your question does not make sense.

First please do not think that the following lines are pedantic: it is
the summary of what I think I learned by hitting so many walls ('appris
sur le tas' in French)
Second: as a consequence, please correct the slightest stupidities.

/Thread/ is a concept that belongs to multi-tasking: how 2 processes
access to the memory (volatile).
/Connection/ is a concept that belongs to the client-server model.
/Commit/ is a concept that belongs to the transactional programming
model: it makes durable the actions of a /unit of work/.

Threads and unit of works resort to 'some kind of locking' to fulfill
their responsibilities but their scope is different.

A database is:

    * a server: as a consequence, a client has access to it via a
      connection object
    * probably multi-threaded (but I tend to think that, as a client
      developer, I don't care except when it comes to performances)
    * that often supports the concept of transactions
    * whose transactional behavior can be tweaked via the connection
      object (via the isolation level).
      http://www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v8infocenter.d2w/report?target=mainFrame&fn=c0004120.htm
      (Look at the phenomena described + follow the link 'isolation levels')

André, I would have rephrased your question in 2 questions:

    * does ZODB supports transactions?
    * What kind of isolation levels does ZODB support?

From what I read so far, the answer to the first question is yes.
I do not not know the answer to the second.

Regards,

-- 
Gérard





More information about the Zope mailing list