On Sunday, March 3, 2013 4:59:58 PM UTC-8, Sid K wrote:
>
> Ok, it looks like the synchronizer instance needs to remain in the calling
> scope for the synchronizer to work. This code (Laurence) works:
>
> synch = MySynch()
> transaction.manager.registerSynch(synch)
>
> while this code (what we w
Ok, it looks like the synchronizer instance needs to remain in the calling
scope for the synchronizer to work. This code (Laurence) works:
synch = MySynch()
transaction.manager.registerSynch(synch)
while this code (what we were doing earlier) doesn't:
transaction.manager.registerSynch(MySynch())
On 3 March 2013 08:37, Carlos de la Guardia
wrote:
> Laurence, did you get it to work like that? I tried before using
> classmethod and wasn't able to make it work.
Ah, you need to implement all methods on ISynchronizer:
>>> class MySynch(object):
... def newTransaction(self, transaction):
.
Laurence, did you get it to work like that? I tried before using
classmethod and wasn't able to make it work.
Carlos de la Guardia
> Pass an instance of the MySynch class rather than the class itself, e.g:
>
> class MySynch(object):
> def beforeCompletion(self, transaction):
> print
On Sunday, 17 February 2013 22:54:30 UTC-8, cguardia wrote:
> Hi,
>
> there were some problems with the code snippets in the book. I updated
> them here:
>
> http://zodb.readthedocs.org/en/latest/transactions.html#before-commit-hooks
>
> For some reason I could only get synch to work using cla
Carlos, great, thanks for the corrections. They appear to be working now :)
On Sun, Feb 17, 2013 at 10:54 PM, Carlos de la Guardia <
carlos.delaguar...@gmail.com> wrote:
> Hi,
>
> there were some problems with the code snippets in the book. I updated
> them here:
>
> http://zodb.readthedocs.org/
Hi,
there were some problems with the code snippets in the book. I updated
them here:
http://zodb.readthedocs.org/en/latest/transactions.html#before-commit-hooks
For some reason I could only get synch to work using classmethod.
Carlos de la Guardia
On Sat, Feb 16, 2013 at 3:56 AM, Siddhartha K