Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by Joerg Jacobsen
Wed, 16 Dec 1992 21:46
customized adaptor and 'update'
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads