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

Dieter Maurer dieter at handshake.de
Sat Jan 8 14:20:55 EST 2005


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!


I assume that the "0" and "1" above refer to values of "self._registered"?
If so, then for some unknown (and not understandable) reason,
the interaction of the transaction's "commit/abort" with your TM instance
did not work correctly. Maybe, your TM instances are persistent?

-- 
Dieter


More information about the Zope mailing list