Mailing List Archive

ExtFile/ExtImage in Zope2 2.13 and Transaction Manager
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I did some tests a year ago about upgrading to 2.13.19. I use
ExtFile/ExtImage extensively and I had to patch it a bit.

I hit the problem that ExtFile tries to import "from Shared.DC.ZRDB.TM
import TM". Messing around a bit, I solved the issue installing
"Products.ZSQLMethods" product (via
<https://mail.zope.org/pipermail/zope/2012-January/176324.html>), but
this is not working with 2.13.21. I am getting tons of upgrade
warnings about zope packages.

The documentation for "Products/ExtFile/TM.py" says this:

"""
TMRegistry and ProxyTM

Use case
- --------

Persistent objects (ExtFiles) need to participate in ZODB transactions.
ExtFiles perform all operations using temporary files which are saved on
commit or deleted on abort.

Constraints
- -----------

- - TransactionManagers (TM) must not be persistent themselves, i.e. must
not have a _p_jar attribute.

- - We have to make sure the ExtFile's _abort is called *before* the ZODB
destroys the attributes of the persistent object.

Solution
- --------

- - ProxyTM is a subclass of TM.TM that keeps a (hard) reference to the
(wrapped) persistent object it manages. Calls to _begin, _finish, and
_abort are forwarded to the target object.

- - TMRegistry is a module-level container for ProxyTMs. It creates and
holds ProxyTMs keyed by (target_id, thread_id).

- - ExtFiles implement _finish and _abort and register with the machinery
by calling TM.register(self).

- - On commit (or abort) the ProxyTM notifies its target object and removes
itself from the registry.

Hacks
- -----

- - We manipulate the transaction's _resources attribute directly. This is
to guarantee the ProxyTM is processed before other resources. There may
be a way to achieve this using official APIs only, but I can't seem to
find one.

"""

How can I solve this?. Is there any product similar to
ExtFile/ExtImage? I can program Python if somebody guides me around
the zope2 internal details...

- --
Jesús Cea Avión _/_/ _/_/_/ _/_/_/
jcea@jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
Twitter: @jcea _/_/ _/_/ _/_/_/_/_/
jabber / xmpp:jcea@jabber.org _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQCVAwUBUobdLJlgi5GaxT1NAQJCbgP/cjU/H48QqZar3/quLDGRdTEBt+5uhIve
zf5SLjWnDDqcDQ0UgEhDm7BbAFC4wLDFL8TV0sP7+jCIrvqT/1P9IXUXJ13o9flV
dW2ni1DILG2zD4G3pES9OQKcMyaoXeZT3/JYwB/KD+TXEnDkek1zCxwRAAdRWveh
PeTL6HCbrWU=
=P7r7
-----END PGP SIGNATURE-----
_______________________________________________
Zope maillist - Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )
Re: ExtFile/ExtImage in Zope2 2.13 and Transaction Manager [ In reply to ]
Jesus Cea <jcea@jcea.es> schrieb:
>I hit the problem that ExtFile tries to import "from Shared.DC.ZRDB.TM
>import TM". Messing around a bit, I solved the issue installing
>"Products.ZSQLMethods" product (via
><https://mail.zope.org/pipermail/zope/2012-January/176324.html>), but
>this is not working with 2.13.21. I am getting tons of upgrade
>warnings about zope packages.

hmm,

i did an install of 2.13.21 one week ago by the easy_install method (with python2.7) as documented on the Zope2 online manual.

With 2.13.21 there was several products which are not longer part of the Zope core installation (bundle) and have to be installed seperately if required.

I've installed ZSQLMethods too by the easy_install method which worked for me without probs, as long as you did not install extensions/products by hand which require further newer Zope core parts - then you will get such version conflicts afaik. This should work with the buildout method too, but not tried it yet.

Do NOT install "core" products "by hand" (around the easy_install or buildout mech) as long as you did not checked the compatibility of that version with your Zope version.


hth
cheers,


Niels.

--
Niels Dettenbach
Syndicat IT&Internet
http://www.syndicat.com
_______________________________________________
Zope maillist - Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )