[Zope] Problems with list of object references

Sven Rudolph rudolph@medical-tribune.de
Mon, 12 Aug 2002 18:00:19 +0200


Hello Paul,

thanks for your quick reply!

> > It seems that the "addresses" of my object instances change a view seconds after loading my buffer. As a result I am unable to save a list of object references for later use.
URGGHH. I meant "a few seconds"  :-(

 
> ...You *should* be able to cache them for a little while...
It is possible, but the cache turns invalid after a few minutes.


>...but they should be dynamically generated when zope starts, at the
> very least, because the IDs WILL change if you do such things
> as delete & recreate one of the objects, or do an import of 
> a backup, etc...
I am planning to regenerate this list every 24h, or manualy via management screen when I need it.
I do this because of performance reasons, because dynamically generating the list is far to slow.
 
> Instead, it's probably better to save a list of *paths*...
That's what I'm doing now. The list is an attribut of my buffer product. After generation it is allready sorted and sliced to my needs (the whole process takes about 1 minute - PIII800MHz,1,5GByteRAM).
I want to use this list in an in-tag, but with paths i have to do it like this:
<dtml-in MY_BUFFER_INSTANCE prefix=x>
<dtml-var "restrictedTraverse(x_item).id"><p>
</dtml-in>

This works, but it is to slow. I want to cache the object references directly in my buffer, without the need of calling restrictedTraverse in the in-tag.


BTW: I forgot to say that I'm using Zope-2.5.1 with Python-2.1.3

Greetings

Sven


-- 
Sven Rudolph, Programmierer
GermanMedicalServices.de GmbH
Unter den Eichen 5, 65195 Wiesbaden
Tel.: 06 11 / 97 46 25 2