On Sat, 2006-04-01 at 18:32 +0200, Michael Van Canneyt wrote: > > In revision 3111 TBufDataset is almost completely rewritten. I've tested > > as much as I could, but it could be that you encounter problems with > > sqldb which weren't there before. > > > > Please test if everything still works ok, and if not, tell me or submit > > a bug-report. > > > > Further I have a question: now sqldb uses a linked-list record buffer, > > Why ? This goes against the recordset idea ?
Why is that against the recordset idea? > > the RecordCount and RecNo properties are something strange. > > > > What should I do with recordcount? I can add a counter which keep track > > of the recordcount. Ie: it does inc(recordcount) if a record is > > appended. > > > > Or I can do a real count of the records, each time recordcount is > > called. > > > > And what about recno? Just define it as -1, or do a quick count to get > > the current record number? > > > > What are your thoughts on this? > > The very idea of TBufDataset was that both recno and recordcount would > always be available. So using a linked list is not so good. > Why did you change that ? Mostly because of speed-issues, and this makes the code far more easier. With the array, if you're iterating through the data, you have to read the pointer to the buffer in the array, and subsequently the data in the buffer. With this new code, the record buffers contain pointers to their precessor en successor. That makes searching and browsing a lot faster. The TDataset only asks the 'next' and 'previous' records from the TBufDataset. Or it uses bookmarks. Well, bookmarks in a linked list are easy, they are just the pointers to the list-items. And using mostly 'next' and 'previous', the linked list is the best solution. For TDataset it's a different story. Joost. JoJo, Joost. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel