[ZODB-Dev] Invalidations

Tim Peters tim at zope.com
Fri May 6 00:31:10 EDT 2005


{Tim]
...
> 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>.

Jim, I think this may point to a deeper, older bug in
ThreadTransactionManager (TTM):  if no synchronizers have been registered
with a thread by the time TTM needs to create a Transaction object, TTM
passes None as the `synchronizers` argument to the Transaction constructor.
That Transaction object will then never learn about any synchronizers that
may register with TTM after this point.  So, e.g., in

     start with a clean slate
     transaction.begin()
     cn = DB.open(whatever)
     ...
     transaction.commit()

cn's afterCompletion() method won't get called.

The base transaction manager doesn't have this problem (if problem it is
...), it's specific to the thread transaction manager.



More information about the ZODB-Dev mailing list