Someone will correct me if I'm wrong, but I think localInstanceIn is working only on an existing object in the datastore. That means that if you create bar into ec2 and you try to do setBarRelationship(bar.localInstanceIn(ec1)) you will get a NullPointerException which could be difficult to track and debug if it happens in the eo class.
So I would recommend to not do it as a cross editingContext exception is "easier" to debug:) Xavier > Hi Chuck, > > On 20/02/2014, at 3:10 PM, Chuck Hill <[email protected]> wrote: > >> It is always safe to call localInstance. My personal preference is to force >> the caller to do that so that they are aware if they have cross EC >> references. > > Ah OK. > >> I can also see the argument for “just do what is safest”. > > I hadn't thought of that benefit to leaving responsibility with the caller. > Anyway, I should pick one as I'm currently doing a bit of each with no > consistency. > > > -- > Paul Hoadley > http://logicsquad.net/ > > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/webobjects%40anazys.com > > This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
