>>> ISynchronizer should grow a new method:
>>> def newTransaction(transaction):
>>> """Hook that is called at the start of a transaction."""
>>> The TM calls this method with the new transaction.
>> I like this, although I don't know what "start of a transaction" means.
> It means that the application has called "begin" on the transaction
> manager. It has signalled that any work it does after the begin call
> should be in this new transaction. The application has set a transaction
I can live with that. I implemented an alternative: call newTransaction
from the TM whenever the TM creates a Transaction object. That turned out
to be a bleedin' disaster (at least wrt some of the nastier ZEO tests), and
your msg came while I was in the bowels of tracking down why. Something to
do with a persistent object changing, and calling its jar's register()
method, which then called TM.get(), which then went "oops! I don't have a
current txn, so I'll create a new one", which then called the jar's
newTransaction() callback, which ... and that's as far as I got. The end
result was that object modifications seemed to "get lost". Sometimes. I'd
be happier not finishing this exercise <0.5 wink>, so TM.begin() it is.
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org