[ZDP] FAQ Entry addendum (was: RE: [Zope-dev] New Counter Pro duct)

Michel Pelletier michel@digicool.com
Thu, 25 Mar 1999 15:32:41 -0500


> -----Original Message-----
> From: John Eikenberry [mailto:jae@kavi.com]
> Sent: Thursday, March 25, 1999 2:08 PM
> To: zdp@zope.org
> Subject: [ZDP] FAQ Entry addendum (was: RE: [Zope-dev] New Counter
> Product)
> 
> 
> Previously posted question...
> 
> Shaw, Howard asked...
> 
> - How can I create a variable within a Product that will not be
>   persistent (i.e. will not be written to disk)?
>   
>         (Michel Pelletier)
>         Prefix your variable name with _v_.  If you don't want the
>         attribute foo to be persistent, call it _v_foo.
> 
> 	(Caveat from Paul Everitt) 
> 	But alas, there's a dark side to this. If you're object gets
> 	swapped out by the Zope cache manager, splat, there goes the
> 	updates since your last change.  Presumably it wouldn't be as it
> 	would be getting used a lot.
> 
>         
>         OR
>           
>         (Pavlos Christoforou)
>         ZODB cannot detect changes to mutable objects that 
> are not treated
>         as immutable. So I suppose that if your object 
> includes a list, a 
>         dictionary or a non persistence instance then any 
> changes to these
>         objects will go undetected by ZODB.
> 
> 

Also not that the changes made to a mutable object *will* be detected
and stored by the database if the object calls self.__changed__(1)


> ---
> 
> John Eikenberry
> [jae@kavi.com - http://taos.kavi.com/~jae/] 
> ______________________________________________________________
> "A society that will trade a little liberty for a little order
>  will deserve neither and lose both."
>                                          --B. Franklin
> 
> 
> 
> 
> _______________________________________________
> ZDP maillist  -  ZDP@zope.org
> http://www.zope.org/mailman/listinfo/zdp
>