Re: persistence and __setstate__

[email protected] (Jeremy Hylton) Wed, 31 Jul 2002 11:42:35 -0400
Newsgroups gmane.comp.python.zope.zodb4
Message-ID <[email protected]>
>>>>> "BAW" == Barry A Warsaw <[email protected]> writes:
>>>>> "JH" == Jeremy Hylton <[email protected]> writes:
  JH> A potential concern for any solution: If the object is updated
  JH> on demand, it is probably important to execute the change as a
  JH> separate transaction.  If you don't, then the object update gets
  JH> mixed in with arbitrary updates to other objects, which
  JH> unnecessarily complicates undo.

  BAW> That's a good point, and sounds like the first approach might
  BAW> work better.  Would the __setstate__ itself be able to do a
  BAW> transaction commit if it updated the object?  If so, that might
  BAW> be enough, if inefficient for updating a large number of
  BAW> objects.  Hmm.

How can you tell if __setstate__ updated the object?  It always
updates the object :-(.

Jeremy