🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1611

NeXT DBKit Adaptor Problem : Please Help !

#1611
From: Yi Zhao
Date: Sat, 26 Sep 1992 01:52
31 lines
1816 bytes
Greetings,

I have a problem with the NeXT DBDatabase (DBKit) Adaptor.
I am writing a custom Adaptor, and I based my implementation on the "SimpleAdaptor"
example given by NeXT, which appears to have bugs.

My question is: Is it the responsibility of the Adaptor code to insert records
into the Binder's container ? The documentation on DBBinder seems to indicate
otherwise; it seems to suggest that the adaptor only has to fetch a row of data in its
- (BOOL)fetchData:(DBBinder*)aBinder method, and that the database will insert the
row into a new record in the container after every invocation of the fetchData:
method.

This is not what I observe.
If I say:
   	[myBinder setDatabase:myDatabase];
  	[myBinder setContainer:myContainer];
    	[myBinder reset];
	[myBinder fetch]
	printf("Count of myContainer = %d\n", [myContainer count]);
I expect the printf to print 2, corresponding to 2 records that I know are present;
however, it prints only 1.

Is the fetchData: method in the Adaptor code responsible for inserting
a record into the Binder's container after it fetches a row of data ?

Is there any sample custom Adaptor code somewhere that I could look at ?
The SimpleAdaptor code from NeXT is real old, the copyright date is 1991.

I would really appreciate any help from you DBKit experts.
Technical Details
Message-ID: <1992Sep26.015217.12232@menudo.uh.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!menudo.uh.edu!yzhao

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!menudo.uh.edu!yzhao
From: yzhao@cs.uh.edu (Yi Zhao)
Subject: NeXT DBKit Adaptor Problem : Please Help !
Message-ID: <1992Sep26.015217.12232@menudo.uh.edu>
Sender: usenet@menudo.uh.edu (USENET News System)
Nntp-Posting-Host: rodin.cs.uh.edu
Organization: Computer Science dept.,  Univ. of Houston (Main Campus)
Date: Sat, 26 Sep 1992 01:52:17 GMT
Lines: 32