Mailing List webobjects-dev@wocommunity.org Message #210
From: OCsite <webobjects-dev@wocommunity.org>
Subject: Re: [WO-DEV] ... too many snapshots?
Date: Thu, 17 Jun 2021 17:00:16 +0200
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Trying to find all the snapshot info I could, I've bumped in the mail archives into two claims which most probably are both valid (given the author), but whatever I do, I can't reconcile them. Anybody here understands this and can explain?

On 28. 2. 2015, at 19:54, Chuck Hill <chill@gevityinc.com> wrote:
ec.committedSnapshotForObject() [which] causes the EC to record the committed snapshot for the object at that point in time.  Normally this is done only at the point the EO first changes

On 19. 4. 2016, at 23:24, Chuck Hill <chill@gevityinc.com> wrote:
IMO each EC should have its own set of snapshots, at least it should grab them at the first point it modifies an EO.  But, alas, it does not.

Thanks a lot,
OC

On 17. 6. 2021, at 14:43, OCsite <webobjects-dev@wocommunity.org> wrote:

Ramsey,

On 17 Jun 2021, at 0:41, Ramsey Gurley <webobjects-dev@wocommunity.org> wrote:
https://wiki.wocommunity.org/display/documentation/EOF-Using+EOF-Caching+and+Freshness
In particular, check out Mark Ritchie's Freshness Explorer application which lets you see how the different layers of the stack propagate changes.

Thanks, but it does not really help. Especially as of

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?

it never touches those suspicious EC.xxxSnapshotForObject things; and the particular code it uses, namely,

===
EODatabaseContext databaseContext = (EODatabaseContext) osc.objectStoreForGlobalID(gid);
EODatabase database = databaseContext.database();
snapshot = database.snapshotForGlobalID(gid);
===

just brings a suspicion whether this things differs from (iii)/(iv) above, and if so, how :(

If anybody knows of a good documentation of all those snapshots, how they differ, when they are created and how they are used, I'd be really grateful.

Thanks and all the best,
OC


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