[Zope3-Users] Reference to a COM object (or other external resource) in a Zope object

thealx at poczta.onet.pl thealx at poczta.onet.pl
Wed May 24 08:32:42 EDT 2006


Hi,

I am creating a kind of Zope proxy to a 3rd party COM object (I'm accessing it using Pywin32 facilities). 
I have to store a reference to this object somewhere in my Zope object.
But, for obvious reasons, this COM object cannot be serialized so I cannot put it in any attribute of my Zope object. 
On the other side, initialisation of the object on each request is too time&cost-consuming. 

>From what I read on the web and this list, _v_xxxx fields won't solve my problem, because the _v_xxxx field may be reset in any time, when (de)serialization occurs.

So I have a question, which may be generalized:
how to properly store/cache a handle or a reference to some OS resource, if I cannot create/alloc and destroy/dealloc it on every request?

I have read somewhere that possibly I can use module variables for this purpose. Is it the 'right' way?


More information about the Zope3-users mailing list