[ZODB-Dev] connection.sync() kills _p_changed?

Christian Robottom Reis kiko@async.com.br
Fri, 13 Jul 2001 13:31:41 -0300 (BRT)


On Fri, 13 Jul 2001, Greg Ward wrote:

> That's not the behaviour I'm observing -- I just tried this, and any
> local, uncommitted modifications are lost on calling sync().  This seems
> correct: I'm sync'ing back to the on-disk database, and my local changes
> aren't on disk.  In fact, the implementation of Connection.sync() is
> pretty clear:

Yeah, I now see you're right: the thing is I store my object's data in
GtkEntries, so the data is actually there even if it isn't in my object at
that moment. When I finally commit() data is pulled from the entries and
the object is refilled with the changed values. Pretty crazy, yeah.

> > Is this the expected behaviour? For now I'm saving _p_changed for the
> > changed object and restoring it after sync(), but I'm not sure that's
> > entirely sane.
>
> Sounds pretty insane to me.

Well, it works for me (and I end up in reality reloading the data from the
form into the object, so whatever was changed before is changed now). It
isn't very clear to the casual observer, however. Hmmm. I like the
semantics, though :-)

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