Two cursors accessing the same records
Ruslan Zasukhin
sunshine at public.kherson.ua
Sat Dec 17 18:37:57 CST 2005
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]
More information about the Valentina
mailing list