RE: [Wonder-disc] WODev "PK on Insert" code causes D2W(onder) problem
RE: [Wonder-disc] WODev "PK on Insert" code causes D2W(onder) problem
- Subject: RE: [Wonder-disc] WODev "PK on Insert" code causes D2W(onder) problem
- From: <email@hidden>
- Date: Tue, 27 Apr 2004 17:00:28 +0200
- Thread-topic: [Wonder-disc] WODev "PK on Insert" code causes D2W (onder) problem
Hi!
There might be code out there that from the fact an object has a permanent globalID (EOKeyGlobalID) concludes that the object ma be found in the database . Such code may go about and create a fault from that global ID and cause trouble when that fault is fired before the object makes it to the database.
With WOnder being open source you should be able to sport such code and ammend.
Pierre
-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Ashley
Aitken
Sent: Tuesday, April 27, 2004 4:37 PM
To: WOdev List List
Cc: Wonder Project
Subject: [Wonder-disc] WODev "PK on Insert" code causes D2W(onder)
problem
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
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Wonder-disc mailing list
email@hidden
https://lists.sourceforge.net/lists/listinfo/wonder-disc
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
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.