[ZODB-Dev] Invalidations
Tim Peters
tim at zope.com
Fri May 6 00:12:44 EDT 2005
[Gary Poster]
> I'm guessing this thread has to do with the recent _synch changes in
> transaction._manager.py. I can't get Zope 3 to [serve pages] without
> the following change to the HEAD (which seems right enough, but this
> is just on the basis of a quick look). Is this right?
It's on the right track -- good eye! It misses a spot, and it's simpler to
repair it inside _new_transaction(). So I did that. Please `svn up` Zope3
and try again. By way of apology, I owe you one free hint to the level of
your choice at:
http://www.pythonchallenge.com/
Staying up all night is a good idea ...
Curious: ZODB 3.4's and Zope 2.8's and Zope3's test suites all let this one
slip by. To provoke this, looks like Zope3 had to do transaction.begin()
before it opened any connections. Nothing wrong with that, it's just
unusual -- at least for human-written code <wink>.
> Index: transaction/_manager.py
> ===================================================================
> --- transaction/_manager.py (revision 30261)
> +++ transaction/_manager.py (working copy)
> @@ -101,6 +101,9 @@
> if txn is not None:
> txn.abort()
> synchs = self._synchs.get(tid)
> + if synchs is None:
> + from ZODB.utils import WeakSet
> + synchs = self._synchs[tid] = WeakSet()
> txn = self._txns[tid] = Transaction(synchs, self)
> _new_transaction(txn, synchs)
> return txn
More information about the ZODB-Dev
mailing list