[ZODB-Dev] Re: Multi-Threading Transactions

Andreas Jung lists at andreas-jung.com
Thu Oct 13 02:57:06 EDT 2005



--On 13. Oktober 2005 02:44:34 -0400 Chris Spencer 
<gmane.20.evilspam at spamgourmet.com> wrote:

>> I understand that, but my point was when you call transaction.commit(),
> you don't necessarily know what you're committing. One thread may be
> ready to commit. Another may not be. If one thread calls
> transaction.abort(), they may be aborting changes made by another thread.
> You'd have to write a complicated coordination mechanism to handle
> multi-threaded transactions to be sure. If threading is limited to
> connections, then wouldn't in make sense if transactions were as well?
>

I have no idea what you mean. Once again: when you are using multiple 
threads to write to the ZODB (as Zope does all the time) then usually
every request is done with a dedicated transaction. The work within the 
threads happens isolated. Only at commit time an error might occurs
when multiple thread write to the *same* object or one writes and one reads 
(already solved by using MVCC in Zope 2.8).  NO idea what you mean by 
"complicated coordination". Hopefully you don't write code that spawns up 
threads that deal will the ZODB in an insane way. This is tricky and you 
should really know what you are doing in this case....this is for 
experienced developers only....

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20051013/3665945d/attachment.bin


More information about the ZODB-Dev mailing list