RE: does EOEditingContext.refreshObject work?
RE: does EOEditingContext.refreshObject work?
- Subject: RE: does EOEditingContext.refreshObject work?
- From: "Adam Ramadan" <email@hidden>
- Date: Sat, 20 Dec 2003 22:15:37 -0500
> >The relevent field is "text", and you're correct, it has changed in the
> >committed snapshot.
> >
> >Before: text = <com.webobjects.foundation.NSKeyValueCoding$Null>;
> >After: text = "whatever";
> >
> Meaning that you have changed text to "whatever" in the editing
> context and
> not saved it and that text is null in the database?
Right - the changes are in the editing context, the value is null in the
database. Calling refreshObject() alters what is returned by
committedSnapshotForObject().
> If you are not using session().defaultEditingContext(), are you
> locking the
> editing contexts that you use? If not this is a potential cause of your
> problem.
Nope, I'm using session().defaultEditingContext().
> If that is not the problem, then report this at
> bugreport.apple.com. It is
> very, very helpful to provide a minimal reproduction case if you
> report a bug.
Ok, will do.
> What is it that you are trying to achieve?
I'm trying to lock the object while one user is modifying it. It's possible
that the lock expires or is removed by an admin, so before I save my changes
I ensure that the user still holds the lock - so I was trying to refresh the
data to see if the user with the lock had changed. If the refresh is buggy I
can redesign this scheme, but if there was a workaround that would let me
somehow tell WebObjects that the field was "dirty" and needed to be saved,
that would save me some time and effort. (I have read the relevent
WebObjects documentation concerning update strategies and what WebObjects
provides, but I couldn't see a way to fully implement my requirements within
their framework).
I didn't realize that this method was new to 5.2.2 - maybe there is a way to
achieve the same result as the refreshObject method does with more mature
methods? I'll experiment a bit.
Thanks a lot for your assistance,
Adam
_______________________________________________
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.