Re: query about after commit hook
Jason Madden <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
> On May 20, 2016, at 10:38, Jim Fulton <[email protected]> wrote: > > This is an approach (Faux IDatamanager's) that I advocated early on. > I regret it now. Sometimes I was too Zealously OO. > > I regret it because: a) It was a pain to implement, and b) still a bit > of a trap. :) I suspect that most shops that do very much of this develop a few base classes to make it easier. Almost certainly one of those base classes is one that accepts function parameters for the various phases---I know we wrote one. The MailDeliveryManager in repoze.sendmail is a decent example of this (https://github.com/repoze/repoze.sendmail/blob/master/repoze/sendmail/delivery.py#L53) (hmm, and it better handles some of the subtleties than ours does, though it does allow tpc_finish to propagate exceptions). This is getting off topic, but as an alternative to or in addition to a mid-transaction hook, maybe such a base class should be part of the transaction package? I think I can even imagine a function decorator similar to contextlib.contextmanager() for producing a basic DataManager. Jason -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.