generating EOGlobalID on EC insertion

Zak Burke <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
I'm running into some weird problems when creating EO primary keys 
immediately on insertion into ECs according to the WikiBook instructions 
here:

http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/Primary_Keys

I am able to create the EO's PK on EC-insert. If I then push the EO into 
a child EC but before I have called parentEC.saveChanges(), the EO it is 
turned into a fault. Relations that were set using parent EC are not 
available on the EO in the child EC -- I get NPEs when I try to access 
them. If I remove the PK-on-EC-insert code, everything in the child EC 
works fine.

Aside from immediately generating a PK, I don't see anything in the 
WikiBook code that changes the behavior of insertObjectWithGlobalID, but 
it seems like there is some side-effect that is causing this trouble.

Has anybody else encountered this problem, or something similar? Any 
hints on how I might work around it?

TIA,

zak.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.