Re: Ghost row in EOF
Re: Ghost row in EOF
- Subject: Re: Ghost row in EOF
- From: Jim Pearson <email@hidden>
- Date: Wed, 3 Dec 2003 10:08:36 -0500 (GMT-05:00)
Gino,
Most of what you've said is OK... there is (typically, unless you've programmed otherwise) a stack of items leading from control down through access, and each user has their own defaultEditingContext in their session. The pool of objects underneath (the snapshot dictionaries) is singular when there is only one DB connection in place, so the basic underlying object graph is shared. The user's view on things is singular to the user.
The displayGroup in which you're seeing the phantom row is probably the root cause... Does the display group fetch on load? Is there a delegate applied to the display group that's doing the fetching, and if so, how and when is it fetching?
P.S. It's probably a good idea to lock the EC before (and unlock after) the deletion.
jimp
-----Original Message-----
From: Gino Pacitti <email@hidden>
Sent: Dec 3, 2003 9:33 AM
To: email@hidden
Cc: email@hidden
Subject: Ghost row in EOF
From: Gino Pacitti <email@hidden>
Date: Wed Dec 3, 2003 1:01:32 pm Europe/London
To: email@hidden
Cc: email@hidden
Subject: Ghost row in EOF
Hi,
I thought I knew enough about the EOF stack but I was mystified by
this behaviour.
I have an app that was running in deployment and it has an web based
administration area where records can be added, modified, deleted etc..
And the actual website where the records can be viewed, a shopping cart.
I understood from the docs that by default EOF used a single stack and
shared the control layer and access layer across sessions.
Each user having there own session defaultEditingContext.
By this I understood that each user has there own object graph based
upon the fetch that was initiated from their context ( the page that
they were on and the records required).
What occured was that I had two open sessions
session 1 for admin deleting a record
session 2 user at main with a set of records loaded and faults not
fired for related items
When the admin removed the object using saveChanges() all seems well.
<!-- start code snippet -->
items.removeObject(itemSelected);
EOEditingContext eContext = itemSelected.editingContext();
eContext.deleteObject(itemSelected);
eContext.saveChanges();
<!-- end code snippet -->
But when the user actually went to views the records in session 2 the
browers showed an empty row in the displaygroup iteration - it seemed
like a ghost object?
Do sessions have access to a shared snapshot in the EOF stack or share
cached fetches that were initiated by other users or is there
notification across sessions ?
BTW when I used eContext.refreshAllObjects() after the saveChanges();
the condition rectified and the ghost row was not visible?
Could anyone perhaps explain this phenomenon or correct my
mis-comprehension of EOF stack.
Best
Gino
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.