[Zope-dev] dtml-sendmail and transactions: Request For Comments

Dieter Maurer dieter@handshake.de
Fri, 10 Aug 2001 22:43:59 +0200 (CEST)


Toby Dickenson writes:
 > A new fishbowl proposal
 > 
 > http://dev.zope.org/Wikis/DevSite/Proposals/TransactionalEmail
 > 
 > Zope's dtml-sendmail tag is not integrated into the
 > transaction system. This leads to two problems:
 >     
 >     o Duplicate copies of each email will be sent if a request has
 >       to be retried due to a conflict error.
 > 
 >     o Emails can be sent even if a request never completes, due
 >       to an error rendering the tail of the page, or a problem
 >       detected at transaction commit.
 > 
 > 
 > Any comments gratefully accepted.
Good, but isn't it difficult to make mail sending transactional:

    The sending may raise exceptions.

    Zope is very angry to get exceptions during the second
    phase of the two-phase commit.

    This means, sending must go into the first phase.
    But in this case, they are sent even if a different
    transaction manager rejects the "commit" request
    (or raises an exception).


Dieter