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 21:04:38 -0500
Ok, I added a System.out of the committedSnapshotForObject:
...
System.out.println(ec.committedSnapshotForObject(e));
ec.refreshObject(e);
System.out.println(ec.committedSnapshotForObject(e));
...
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";
If this is a bug, is anyone familiar with it, or could someone suggest
possible workarounds to try? I'm fairly new to WebObjects and don't have a
full grasp of all the intricacies of Enterprise Objects....
Thanks,
Adam
-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Chuck Hill
Sent: December 20, 2003 20:29
To: Adam Ramadan; WOdev List List
Subject: Re: does EOEditingContext.refreshObject work?
What does ec.committedSnapshotForObject(updatedObject) show? Does it
contain your unsaved changes? It sounds as if doing the refresh has
resulting in the committed snapshot containing the updated attributes.
This, obviously, would be a bug.
Chuck
At 06:43 PM 20/12/2003 -0500, Adam Ramadan wrote:
>Hi,
>
>I have an enterprise object which has been modified and before saving the
>changes I want to refresh the object in order to check one of its fields.
>After calling refreshObject(...) I see any changes to the field I'm
>interested in, and the changes that had been made to the enterprise object
>are still there, as expected from reading the JavaDoc. Unfortunately, the
>EOEditingContext.hasChanges() now returns false (it returns true prior to
>the refreshObject() call, and the object being refreshed is the only
>modified object in the context). Even if I modify the object again the
>EOEditingContext seems completely unaware, and the saveChanges method()
does
>nothing.
>
>I haven't done anything fancy with my enterprise objects, they are what was
>generated from the EOModeler, and no methods have overridden or anything
>like that.
>
>Am I misunderstanding something? Is this a bug in WebObjects (I'm using
>version 5.2.2, Java 1.4.1_05, on Windows 2000)?
>
>Thanks very much for any help,
>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.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.