Understanding the Cursor

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Aug 24 04:26:20 CDT 2004


On 8/24/04 1:32 AM, "Barney" <barney at custombased.com> wrote:

> Hello Ruslan and list,
> 
> Could I be really dumb and ask the following. Alternatively is there any
> existing data or info I can read regarding the following ?
> 
> I have read thru V4RBReference many times but I still come away not really
> understanding what I read about creating a cursor. The docs rightly assume I
> know some elementary things, but actually I don't. Consequently I just try
> different things until I find a cursor that works.
> 
> 
> 1.) What does CursorLocation mean ? Client or server, what difference does
> this make, how and why would I take this into consideration when writing a
> database app that a.) is being served or b.) is just a single 1 user
> embedded database app.

Single user mode should use kServer.

Because then THE SAME code will work on Vserver!
Is this good? This is great!

So it is always good idea, write code in such way that you can in 5 minutes
run it on Valentina Server future.

 
> 2.) LockType ... If NoLock is used, does this mean that the code has
> complete unrestricted access to the records in the cursor whereby it can
> read, write, delete and in a served situation others can do the same at the
> same time ? 

Yes.

This works like Valentina 1.9.8 and early.

But note, IF you run such code on Valentina server you may get "special
effects".


> Obviously in a single user app LockType will be of no concern as the GUI to
> the app we build only lets users do what we want them to anyway. We would
> just use NoLock the whole time, just as we did prior to advent of Vserver
> being introduced along with new V4RB plugin with these parameters in SQL
> Statement.

If GUI protect you then good.
Exists apps which allow work in way similar to mutli-user.
E.g. Few windows keep own cursor.

> If ReadWrite is used does this mean the record is locked or not ?

Yes it is locked for READ WRITE aka EXCLSUIVE lock.

The most strict mode.


> 3.) DirectionOfCursor.... again, sorry but what does this mean ? I'm afraid
> I have no idea what this is. How should I be taking this into consideration
> when writing code to access database.

You can always use Random.

ForwardOnly -- means that you PROMISE always will do only
cursor.NextRecord(). This can help to Valentina faster remove locks from
records which you already have gone.


> I realise I'm lacking some fundamental understanding here. With the advent
> of server which is just awesome, there is a little learning to do about how
> this all works. Any reading info or clarification would be a big help.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list