API vs SQL vs Classes

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Mar 30 01:09:54 CDT 2007


On 25/3/07 12:11 PM, "Kim Kohen" <kim at webguide.com.au> wrote:

> Now a question about cursor record locks (the SQL recordlock example
> won't compile here).  Say I have cursor1 and it is read only and I
> use it to display an un-editable list of records. I also have cursor2
> which I use to display the full data from a record which is selected
> in the listbox. Will the lock on cursor1 stop me from opening the
> record in cursor2 and editing it?

YES

Cursor1 in this case should have kNoKocks parameter.
Or you need make cursor1 as ReadWrite and use itself to edit records.

> Another situation. I do a search for 'fireman' and return 10 records
> into my listbox which is read only. A second user does a search for
> LIKE '%fire%' while my cursor is still active. Will the second user
> generate an error or will it still display fine?

Second user will get error ONLY if first user have set kReadWrite locks,
Keep in mind

    ReadWrite == EXCLUSIVE
    ReadOnly  == SHARED
 

> Also on cursors, is it *necessary* to run them in threads or just
> useful for large numbers of users?

Cursors are nice even in single thread and single user.

YES they can be used in several threads.
So each thread have own cursor.
Actually thread model is kind of multi-user
 

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list