[Zope-dev] Zope's Transaction manager
Jim Fulton
jim@digicool.com
Thu, 02 Dec 1999 15:58:41 +0000
Pavlos Christoforou wrote:
>
> Hello Zopistas.
>
> I want to register an object with the transaction manager.
For what purpose?
> I have
> inherited from TM.py and overloaded tpc_finish and tpc_begin and it does
> not seem to work.
You need to override _begin, _finsh, and _abort,
not tpc_finish and tpc_begin. (The doc string was wrong,
I just checked in a fix to it.) You also need to call
self._register() to actually register with the transaction manager.
> They are never called. I have even tried registering the
> object with bobo_before, which I assume it is called before anything else.
Don't mess with bobo_before.
>
> Does anyone have Tips/HowTo on how to make objects participate in Zope's
> transaction?
TM is mainly there for database adapters to coordinate with an
RDBMS transaction system. It assumes that most of the work in
commiting or rolling back changes is done by the external database.
If you want to implement transactional behavior yourself, it would
be better to implement the transaction management api's more directly.
We have a model that described these APIs. We'll publish it and let you
know where it is.
Jim
--
Jim Fulton mailto:jim@digicool.com
Technical Director (888) 344-4332 Python Powered!
Digital Creations http://www.digicool.com http://www.python.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.