[Zope-dev] deciding whether to do work in tpc_vote or tpc_finish

Laurence Rowe l at lrowe.co.uk
Tue Jun 8 07:56:49 EDT 2010


On 8 June 2010 12:48, Chris Withers <chris at simplistix.co.uk> wrote:
> Christian Theune wrote:
>> If
>>
>> you have more than one then it can happen that the first one committed,
>> but the second one doesn't and then you can't properly roll back.
>
> Okay, but this is quite a common occurrence now. For example, many projects
> will use zope.sendmail and zope.sqlalchemy together...
>
> I'd guess there are a few "transactional file on disk" components out there
> that play in this area too...

As zope.sendmail commits in tpc_finish, there is no additional issue
using it with zope.sqlalchemy in 1pc than with a 2pc data manager. If
it fails you will end up in an inconsistent state whatever. It's just
that with the maildir implementation, it pretty much can't fail as it
is only a rename and that should always succeed. Really, it should
register as an after commit hook instead. When an after commit hook
fails, the error is caught, logged, and then it continues.

Laurence


More information about the Zope-Dev mailing list