Hi all. 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. I've created the following sample product, named CacheProduct. It has two methods which can be called from the web, registerFromWeb and resetMe. The first calls the _register, the second puts the self._registered variable to 0. I've also added some prints, in order to check the results. 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? Regards Marco
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
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
participants (2)
-
Dieter Maurer -
Marco Bizzarri