[ZODB-Dev] afterCommitHook

Dieter Maurer dieter at handshake.de
Wed Sep 21 14:23:05 EDT 2005


Victor Safronovich wrote at 2005-9-21 17:19 +0600:
> ...
>I   used  a  MailHost  product  for  e-mail notifications, but it sends mails at
>runtime. And when there are errors in transaction, objects have been created and its not
>commited, but users received mails.
>
>I  think i must use an after commit hook, but transactions not supported such
>hooks.

Do you not want to send the email and make the SQL/ZODB modification
in the *SAME* transaction?

Your approach would send the email after the transaction.
When the sending failed, your transaction were committed nevertheless.

Jens made a transaction aware mailhost. I think, its name
is "MailDropHost". It opens a connection to the mail server,
lets it check all of the message (and reports any problems)
but delays the final "commit" until the transaction is committed.

As an additional advantage, this could already be implemented
with ancient ZODB versions -- it does not need any extensions.


-- 
Dieter


More information about the ZODB-Dev mailing list