Clearing _v_ attributes
Hi, To clear some data caching I have made using _v_ attributes on one particular object, I would need a way to programmatically clear its _v_ attributes. As far as I understand, _v_ attributes are set per ZODB connection. And they are cleared when the object is, for some reason, reloaded from the ZODB to the connection cache. As I use the current configuration : + ZEO + 1 Zope instance with RW connections to ZEO + several Zope instances with RO connections to ZEO I was wondering if, setting self._p_changed=1 on the object from the Zope RW would work. Thanks for your help. Pascal ********************************************************************** 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 **********************************************************************
+-------[ Pascal Peregrina ]---------------------- | Hi, | | To clear some data caching I have made using _v_ attributes on one | particular object, I would need a way to programmatically clear its _v_ | attributes. | | As far as I understand, _v_ attributes are set per ZODB connection. | And they are cleared when the object is, for some reason, reloaded from the | ZODB to the connection cache. | | As I use the current configuration : | + ZEO | + 1 Zope instance with RW connections to ZEO | + several Zope instances with RO connections to ZEO | | I was wondering if, setting self._p_changed=1 on the object from the Zope RW | would work. No... Why not just add a clearCaches() method that Does The Right Thing(tm) and call that? -- Andrew Milton akm@theinternet.com.au
Pascal Peregrina wrote at 2005-1-19 10:42 +0100:
... removing "_v_" attributes ... I was wondering if, setting self._p_changed=1 on the object from the Zope RW would work.
It will but only in all other connections (i.e. not in the one that executes the code above). Also, it will cause writing of the object (and bloat your data file). -- Dieter
participants (3)
-
Andrew Milton -
Dieter Maurer -
Pascal Peregrina