[ZODB-Dev] Re: Multi-Threading Transactions

Jeremy Hylton jeremy at alum.mit.edu
Thu Oct 13 09:28:19 EDT 2005


On 10/13/05, 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?

The default transaction manager maintains a separate transaction for
each thread.  When you call transaction.commit() from thread T1, it
commits the transaction for thread T1.  It has no effect on other
thread's running transactions.

Jeremy


More information about the ZODB-Dev mailing list