[Zope] _finish and _abort not called in a TM subclass

Marco Bizzarri m.bizzarri at icube.it
Sun Jan 9 09:51:13 EST 2005


Dieter Maurer wrote:
> Marco Bizzarri wrote at 2005-1-8 04:40 +0100:
> 
>>I'm trying to figure out the proper way to use the Shared.DC.ZRDB.TM.TM 
>>mixin class. According to the documentation, I should derive from that 
>>class, redefine my _abort and _finish methods, and then call the 
>>_register method whenever it is needed.
> 
> 
>>...
>>If all goes well, I should see something like:
>>
>>before: 0
>>after: 1
>>_finish
>>
>>However, if I use ab to do a check, like
>>
>>ab -c 10 -n 1000 http://server:8080/CacheProduct/registerFromWeb
>>
>>I can see:
>>
>>_before: 1
>>_after: 1
>>
>>which should never happen. Also, I don't see the required calls to 
>>_finish. After some request, the _finish reappers, only to disappear again.
>>
>>Has anyone any suggestion on this topic?
> 
> 
> I use it for connections to an SAP system -- and it works well.
> There are indeed no needs other than to define '_finish' and '_abort'.
> Note, however, that TM instances should *NOT* be persistent!
> Persistent TM instances can behave weird!

My problem was exactly that: I was deriving from SimpleItem and TM, 
therefore the weirdness.

Thanks for your insight on this topic.

Regards
Marco


More information about the Zope mailing list