durusmail: quixote-users: dulcinea.contact: a bug, and making the data persistent
dulcinea.contact: a bug, and making the data persistent
2004-09-18
2004-09-18
dulcinea.contact: a bug, and making the data persistent
2004-09-19
dulcinea.contact: a bug, and making the data persistent
Toni Alatalo
2004-09-19
On Sat, 18 Sep 2004, David Binger wrote:

> > the Durus persistence mechanisms, in the sense that changes to the
> > classes
> Do you really mean changes to the *classes*?  The persistence mechanism
> (of Durus) maintains persistent instances, so class attribute changes

uh, sorry - no i did not mean classes at all, but instances as usual.

> > Intervening with __setattr__ might be one, but probably not be good -
> I would not recommend intervening with __setattr__.

right.

> Overriding the methods seems like the clearest way to get the
> behavior you are describing.  I think you should consider changing

ok.

> to the strategy of calling commit after a consistent set of changes is
> completed.

definitely, though as a first implementation having sometimes several of
those calls occurring after each other has not caused problems (but i
haven't really looked into what is happening in terms of the db file etc)

> The line "self._p_changed = 1" in a method, after changes to
(..)
> the source for durus.persistent_dict.PersistentDict for an example of

thanks for the hint, though i probably won't be needing that (persistent
classes and persistentdicts & -lists as containers (in them) work fine).

~Toni


reply