[ZODB-Dev] Confusion about persistent dictionaries / lists

Christian Robottom Reis kiko@async.com.br
Tue, 3 Jul 2001 17:12:15 -0300 (BRT)


On Tue, 3 Jul 2001, Jeff Sasmor wrote:

> Ah - so then the entire object is marked for storage if one
> of its 'normal' attrs is changed.  I wonder if this is a behavior that
> is confined to Zope or would occur in any situation using
> ZODB.

It will happen with _any_ class which can't inherit from Persistent.
Meaning:

class Bar:
	a = 0
	pass

class Foo(Persistent):
	bar = Bar()
	pass

f = Foo()
get_transaction().commit()
f.bar.a = 1
get_transaction().commit()

Will result in the last change going unnoticed. This happens with list and
dictionaries because they can't inherit from Persistent.

Take care,
--
/\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil
~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311