cursor/api

Ralf Sander ralf at end-if.de
Thu Feb 10 00:42:31 CST 2005


Hi list,

I am currently at a point where I have to decide to use sql or api way 
in my application (Realbasic / Multiuser invironment -Vserver)
But I think, I did not really understand yet, how the new api will work 
in Server mode.


The app:
Records will be displayed in a custom canvas (draw event gets data 
directly from cursor)
Many users should be able to view the same records, Records can be 
added to a view and views can be sorted
I did some testing with a single user database and don't really know if 
this transferable.

Cursor way:
I need to use "knolocks" because "kreadonly" lets only one user read a 
record.
Works good so far. If a record has been deleted outside the cursor, the 
record has just no values in the cursor, the record don't become nil. 
Also no problem with reused RecIDs. Will I get the same results with a 
served database?
But I see a possible problem with speed. I have to store a sql search 
request as a string for the current view of one user. If the user adds 
a (existing-not new)  record to the current view, the sql request has 
to be modified and re-performed. Could this be a problem, if the 
current search is very complex respectively would the api way be much 
faster?

Api way:
The new api way is much more flexible, Adding records to a found set, 
sorting etc.
But:
Because its all based on RecIDs, which will be reused, does this work 
in an multiuser invironment?

Example:

mDataBase.mPerson.Field("string_fld").FindContains("aa") returns a Vset 
with 10 records, which I use for displaying.
If I delete the first record with mDataBase.mPerson.DeleteRecord, the 
iterator still loopes 10 times returning the value of record 2 for the 
deleted record 1.

Or will I have to create my own structure to ensure not to get deleted 
records or records with reused recids?


Cheers,
Ralf









More information about the Valentina-beta mailing list