setting foreign key using an object in shared editing context (5.2.1)
setting foreign key using an object in shared editing context (5.2.1)
- Subject: setting foreign key using an object in shared editing context (5.2.1)
- From: Nick Pilch <email@hidden>
- Date: Wed, 9 Jul 2003 14:18:49 -0700
I've come across a strange problem. I have an object that has a
relationship to a shared object. Both the foreign key in the main
object and the primary key of the shared object are *not* marked as
class properties. I am trying to populate the foreign key of a new
main object by calling takeValueForKey() with an existing shared
object. I see that the relationship is populated, but on
saveChanges(), the foreign key is never set! The SQL output shows EOF
just setting the foreign key to null.
I've found a work-around, but it seems bizarre. If I get the object
from the shared editing context, then I call
setSharedEditingContext(null) on the current EOEditingContext, and
then I use localInstanceOfObject() on the shared object, it works!
(BTW, I've tried addObjectsToBothSidesOfRelationshipWithKey() instead
of takeValueForKey(), but there's no difference. There's no back
relationship anyway)
Anyone else run into this?
Something that may come into play is that I am doing this in a
multi-threaded app in which each session has its own
EOObjectStoreCoordinator. However, I am testing using a single
request with no other requests being handled concurrently.
--
Nick Pilch / email@hidden
_______________________________________________
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.