[ZODB-Dev] Re: Savepoints are invalidated once they are used

Jim Fulton jim at zope.com
Tue Jul 12 06:44:50 EDT 2005


Christian Heimes wrote:
> Tim Peters wrote:
> 
...

> Nesting savepoints works according to your test and I really believe you 
> that they work in real live. Honestly! :)
> But there is some evil code in transaction/ that is destroying 
> savepoints for my use case. Committing a subtransaction using the old 
> and deprecated transaction.commit(1) syntax is invalidating all 
> savepoints. The invalidation would be harmless but the zcatalog has a 
> nasty feature. It is committing a subtransaction + GC cleanup after 
> cataloging n object in a transaction. IIRC n=10,000 by default which 
> might be reached much earlier than one can imagine.

subtransactions != savepoints

There is *no* promise of nestability with subtransactions.
Committing a subtransaction invalidates prior savepoints by
design.  This is necessary to maintain backward compatibility.
If you don't like this behavior, don't
use subtransactions.  A good community project would be
to convert all of the subtransaction calls in Zope to
savepoint calls.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the ZODB-Dev mailing list