Thanks Fabian.
It seems I am not reading carefully enough this mailing list...
I'll use a nested (child) context to solve the problem.

JPM

Le 30 sept. 06 à 15:22, Fabian Peters a écrit :

Hi Jean Pierre,

See <http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/ Using_EOF/EO_Editing_Context>

This has been taken from a long thread on this topic back in may: <http://lists.apple.com/archives/Webobjects-dev/2006/May/ msg00615.html>

HTH

Fabian

Am 30.09.2006 um 15:10 schrieb Jean Pierre Malrieu:

Hi,

here is the code:

        EOEditingContext ec1 = new EOEditingContext();
    EOEditingContext ec2 = new EOEditingContext();
    EntityA a = new EntityA();
    ec1.insertObject(a);
EntityA local_a = (EntityA) EOUtilities.localInstanceOfObject (ec2,a);


At the end of this code, local_a is null.
That is: localInstanceOfObject returns null if the original object has not been saved to the database.

if I do:

        EOEditingContext ec1 = new EOEditingContext();
    EOEditingContext ec2 = new EOEditingContext();
    EntityA a = new EntityA();
    ec1.insertObject(a);
         ec1.saveChanges();
EntityA local_a = (EntityA) EOUtilities.localInstanceOfObject (ec2,a);

Then local_a is NOT null, as expected

This happens to me on WO 5.3.2 (xcode 2.4) on MacOSX.

Could someone confirm this?
If this is really what happens, isn't this a bug?

Thanks.

JPM.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/lists.fabian% 40e-lumo.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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to