[ZODB-Dev] TypeError: unbound method beforeCompletion() must be called with Synchronizer instance as first argument (got Transaction instance instead)

Alexandru Plugaru alexandru.plugaru at gmail.com
Tue Jul 26 07:58:15 EDT 2011


Hi Stéphane,

I think you create an issue here:
https://github.com/cguardia/ZODB-Documentation (or maybe even fix the
example)

Kind regards,
Alex.

On 26 July 2011 14:51, Stéphane Klein <stephane at harobed.org> wrote:

> Le 26/07/2011 13:48, Wichert Akkerman a écrit :
> > On 07/26/2011 01:47 PM, Stéphane Klein wrote:
> >> Hi,
> >>
> >> I've this in my source code :
> >>
> >> from zope.interface import implements
> >> from transaction.interfaces import ISynchronizer
> >>
> >> class Synchronizer(object):
> >>        implements(ISynchronizer)
> >>
> >>        def beforeCompletion(self, transaction):
> >>            print("beforeCompletion")
> >>
> >>        def afterCompletion(self, transaction):
> >>            print("afterCompletion", transaction)
> >>
> >>        def newTransaction(self, transaction):
> >>            print("newTransaction", transaction)
> >>
> >> ...
> >>
> >> transaction.manager.registerSynch(Synchronizer)
> >
> > I bet this works:
> >
> > transaction.manager.registerSynch(Synchronizer())
>
> Ok, thanks then there are an issue here :
>
> http://www.zodb.org/zodbbook/transactions.html#synchronizers
>
> Regards,
> Stephane
>
> --
> Stéphane Klein <stephane at harobed.org>
> blog: http://stephane-klein.info
> Twitter: http://twitter.com/klein_stephane
> pro: http://www.is-webdesign.com
>
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> https://mail.zope.org/mailman/listinfo/zodb-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zodb-dev/attachments/20110726/f198c584/attachment.html 


More information about the ZODB-Dev mailing list