Mailing List webobjects-dev@wocommunity.org Message #203
From: OCsite <webobjects-dev@wocommunity.org>
Subject: Re: [WO-DEV] merging changes upon a save: what are “locally uncommitted changes”, too many snapshots?
Date: Wed, 16 Jun 2021 22:56:26 +0200
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
I guess I should dig out my copy of “Practical WebObjects” and check if it was not in there :)

Thanks,
OC

On 16. 6. 2021, at 21:27, Jesse Tayler <webobjects-dev@wocommunity.org> wrote:

I know at some point in time Chuck Hill documented to the very edge of the edgiest edge case

Alas, I’d guess that be lost in a wiki of unknown whereabouts…I do not seem to have it myself…but it exists...

On Jun 16, 2021, at 3:23 PM, OCsite <webobjects-dev@wocommunity.org> wrote:

Hi there,

is the process of merging changes upon a save into other ECs, and all the kinds of snapshots available, documented somewhere in detail?

My old EOEditingContextConcepts says just this:

... However, locally uncommitted changes to objects in the EOEditingContext are by default reapplied to the objects, in effect preserving the uncommitted changes in the object graph. After the update, the uncommitted changes remain uncommitted, but the committed snapshots have been updated to reflect the values in the EOObjectStore.

and I can't see what does it actually mean “locally uncommitted changes” here. Most probably a difference from some snapshot, but I admit I am sort of lost in the things.

So far I lived in impression that (if we ignore undo) there's only one kind of snapshots: OSC-level shared snapshots of what-was-just-saved-into-DB.

I've tried to research the thing a bit and there seem to be at the very least the following snapshots:

(i) EC.committedSnapshotForObject
(ii) EC.currentEventSnapshotForObject
(iii) EODatabaseContext.snapshotForGlobalID
(iv) EODatabaseContext.localSnapshotForGlobalID

I regret to say the standard documentation does not help much. I did some testing and it looks like

- (iii) is the one snapshot I knew: whenever save finishes, it always contains the newly saved values
- (i) and (ii) — which for me always contain same data, that's weird! — seem to contain an EC-level snapshot stored at its (first) willChange. Also it looks like those “locally uncommitted changes” are based on (one of) these. So far though I haven't found a case when (i) would differ from (ii)... although, based on the name, I would actually presume (i) should be the same as (iii). It very definitely is not.
- (iv) I don't understand at all :(

Are those things somewhere documented in detail?

Thanks and all the best,
OC



Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster