WODev "PK on Insert" code causes D2W(onder) problem
WODev "PK on Insert" code causes D2W(onder) problem
- Subject: WODev "PK on Insert" code causes D2W(onder) problem
- From: Ashley Aitken <email@hidden>
- Date: Tue, 27 Apr 2004 22:36:34 +0800
Howdy All,
I'm using some code from WODev (thanks to Pierre Barnard et al.) to get
a PK for my EOs on inserting them into an editing context.
<http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?
wikiPage=AssigningPrimaryKeyOnInsert>
Basically, the code overrides
_insertObjectWithGlobalID(EOEnterpriseObject eo, EOGlobalID globalID)
for the EC, gets a PK from the database and calls super with a globalID
based on that rather than a temporary globalID.
It all seems to work fine
Until I use the newly inserted eo with D2W(onder) in an EditPage and a
user tries to editRelationship for the eo (remember, the eo has been
given an primary key and inserted, but not saved to the database).
I get this exception:
com.webobjects.eoaccess.EOObjectNotAvailableException: No Client found
with globalID: _EOIntegralKeyGlobalID[Client (java.lang.Integer)9]
ERXDatabaseContextDelegate.java 113 databaseContextFailedToFetchObject
er.extensions
If I save the EO first, then go back and edit the relationship, all
really works fine. But then that isn't elegant and negates the whole
idea of getting the PK on insert.
The code from WODev is a year or more old, could something have changed
in EOF, or could it be a problem with Project WONDER?
Any ideas?
Thanks in advance,
Ashley.
--
Ashley Aitken
Perth, Western Australia
mrhatken at mac dot com
_______________________________________________
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.