Article View: comp.sys.next.programmer
Article #2104customized adaptor and 'update'
From: Joerg Jacobsen
Date: Wed, 16 Dec 1992 21:46
Date: Wed, 16 Dec 1992 21:46
58 lines
2279 bytes
2279 bytes
Hi Guys,
don't seem to be able to solve this by myself...
I'm currently writing a customized adaptor and have a hard time getting
the 'update' mechanism to work. This is the scenario:
Let's say you have a DBRecordList object set up like in the 'AddressBook'
example. Excerpt from Controller.m:
recordList = [[DBRecordList alloc] init];
/* A unique key is needed if you want to update or insert new
* data via the record list into the database. If no key is defined,
* the data retrieved via the record list is read-only.
*/
keyList = (List *)[[List alloc] init];
[keyList addObject:authId];
[recordList setKeyProperties:keyList];
[keyList free];
[recordList setProperties:propertyList ofSource:authorEntity];
[recordList setDelegate:self];
[recordList addRetrieveOrder:DB_AscendingOrder for:lastName];
[recordList addRetrieveOrder:DB_AscendingOrder for:firstName];
[recordList fetchUsingQualifier:nil];
Then you do a bunch of changes to the records of this list and finally
execute
[recordList saveModifications];
But instead of just letting the adaptor quitly modify its data source
the recordList's delegate gets bugged with a DBFailureCode
DBRecordKeyNotUnique.
(In my DBModel I have set the authId property also to be 'unique key'.
Needless to say that my table does _not_ have duplicate keys.)
I know that my description of the problem leaves room for a lot of
speculation but maybe it still resembles some pattern?
Question:
Should I hold my adaptor responsible for this symptom or could the
DBModel already screw things up like this (unfortunatly I have neither
Oracle nor Sybase to check it out)?
thanks,
Joerg Jacobsen.
--
Jacobsen Softwareentwicklung jacobsen@tpki.toppoint.de (NeXTmail)
W-2300 Kiel Voice: (+49) 431 805467
Germany Fax: (+49) 431 553623
Technical Details
Message-ID:
<1992Dec16.214652.25134@tpki.toppoint.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!fub!tpki.toppoint.de!jacobsenShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!fub!tpki.toppoint.de!jacobsen From: jacobsen@tpki.toppoint.de (Joerg Jacobsen) Subject: customized adaptor and 'update' Organization: Toppoint Mailbox e.V. Date: Wed, 16 Dec 1992 21:46:52 GMT Message-ID: <1992Dec16.214652.25134@tpki.toppoint.de> Lines: 58