Two cursors accessing the same records

Dave Addey listmail1 at dsl.pipex.com
Sun Dec 18 18:42:55 CST 2005


Hi Ruslan,

Thank you!  This seems to work well.

This reminds me - I'm using V4RB 2.0.5 in a local-database-only setup (no
client-server - just a local database).  Should I use kServerSide for all of
my cursors?

Dave.

> From: Ruslan Zasukhin <sunshine at public.kherson.ua>
> Reply-To: Valentina Developers <valentina at lists.macserve.net>
> Date: Sat, 17 Dec 2005 18:37:57 +0200
> To: "valentina at lists.macserve.net" <valentina at lists.macserve.net>
> Conversation: Two cursors accessing the same records
> Subject: Re: Two cursors accessing the same records
> 
> On 12/16/05 7:31 PM, "Dave Addey" <listmail1 at dsl.pipex.com> wrote:
> 
> Hi Dave,
> 
>> Hi there,
>> 
>> Is it safe for me to have one cursor open on a table, accessing various
>> records for read only, and then to open another cursor for one record in the
>> table, to read and update its values?
> 
> Second cursor will be able do this only for a record(s) not selected by
> first cursor. 
> 
> You cannot get WRITE lock on a record which have at least one reader.
> 
>> Will the first cursor¹s values get updated when I UpdateRecord in the second
>> cursor?  
> 
>> What locks, if any, should I put in place?
> 
> Well, you can get behavior which you describe if you will do
> 
>     curs1 = db.Select( query, kServerSide, kNoLocks )
> 
>     curs2 = db.Select( query, kServerSide, kReadWrite )
> 
> So first cursor do not lock records at all.
> 
> YES first cursor will see changes made by second cursor.
> This is like transaction mode: DIRTY READ.
> 
> 
> -- 
> 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]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina




More information about the Valentina mailing list