[Zope] Clearing _v_ attributes

Pascal Peregrina Pperegrina at Lastminute.com
Wed Jan 19 07:34:01 EST 2005


Ok I think now I get it. :)

What about acutally changing some persistent attribute on the object ?
Would that work ?

Pascal


-----Message d'origine-----
De : zope-bounces at zope.org [mailto:zope-bounces at zope.org]De la part de
Andrew Milton
Envoyé : mercredi 19 janvier 2005 12:51
À : Pascal Peregrina
Cc : 'zope at zope.org'
Objet : Re: [Zope] Clearing _v_ attributes


+-------[ Pascal Peregrina ]----------------------
| If I do a clearCaches() method that clears _v_ attributes on the object,
how
| can I make sure it will clear these attributes in all the Zope connections
| that may have a cached copy of the object ?

Basically you can't. Although if a thread doesn't wake up for 10 mins (with
your object), then odds are it'll get thrown out and brought back in again
without the _v_ attributes set, so it's probably a moot point.

You would have to grab each ZODB connection present, grab your object and
call
the method.. That's just getting in voodoo you probably don't actually need.

The best you could do would be to set a flag / timestamp. Any object that
woke
up would have to check that timestamp and work out whether to flush at that
point 
or not.

| Or do you mean that clearCaches() should do the self._p_changed=1 ?

_p_changed = 1 won't flush your _v_ attributes.

-- 
Andrew Milton
akm at theinternet.com.au
_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



More information about the Zope mailing list