[Zope-dev] Re: Zope 2.7 and objects turning into None

Tim Peters tim at zope.com
Tue Feb 24 17:30:35 EST 2004


[Dieter Maurer]
> This means that the current transaction references a connection
> that is meanwhile closed.
>
> Some earlier request forgot to commit or abort the transaction;
> therefore, the transaction contains still references to the former
> connection.
>
> I had to fix product installation code because Zope forgot an
> abort when the installation of a product did not succeed.
> Apparently, this is not your problem.

When a connection is closed while modifications are pending for that
connection, what *should* happen?  Jeremy & I were just talking about that,
and agree the current "benign neglect" sucks -- a subsequent attempt to
commit the transaction can't succeed, and will fail in one of these obscure
ways.

It certainly wouldn't be right to commit the current transaction "by magic"
when a connection is closed.  It doesn't seem right to abort it by magic
either, since it could, e.g., be that the connection being closed has no
changes pending, but that other connections do have changes pending in the
transaction, and silently aborting them could be a real surprise.

I think I'd like to raise an exception when a connection is closed but
changes from that connection are pending in the current transaction.  Would
anyone object to that?  I doubt it was ever *intended* that transactions
could be left in unusable states (or, if it was intended, the design has
proven flawed in this respect).  ZODB 4 kept track of enough stuff so that
it was easy to do this there; ZODB 3 would require more work.




More information about the Zope-Dev mailing list