V4WS 1.11 Problem with kReadWrite following kReadOnly lock

Steven Ronald stevenrt39 at yahoo.com.au
Fri Jan 18 19:05:49 CST 2008


Ruslan,

*** Background to problem ***

Scenario 1:

cursorRef_C=valSQLSelect("SELECT RecID FROM C WHERE
c1='" & c1 & "'", 1, 2, 2);
cursorRef_C=valSQLSelect("SELECT RecID FROM C WHERE
c1='" & c1 & "'", 1, 2, 2);

Result: works

Comments: This is as expected, since I am doing read
only with each cursor, so I should indeed be able to
have multiple cursors existing at the same time (note
1,2,2=kClientSize,kReadOnly,kRandom)

Scenario 2:

cursorRef_Csoft=valSQLSelect("SELECT RecID FROM C
WHERE c1='" & c1 & "'", 2, 3, 2);
cursorRef_Csoft=valSQLSelect("SELECT RecID FROM C
WHERE c1='" & c1 & "'", 2, 3, 2);

Result: doesn't work

Comments: This is as expected since the first cursor
locks the record, so when I attempt to lock the same
record with the second cursor I get the "cannot set
record lock" error  - correct behavior (note 
2,3,2=kServerSide,kReadWrite,kRandom).

Scenario 3:

cursorRef_Csoft=valSQLSelect("SELECT RecID FROM C
WHERE c1='" & c1 & "'", 2, 3, 2);
cursorRef_Csoft=valSQLSelect("SELECT RecID FROM C
WHERE c1='" & c1 & "'", 1, 2, 2);

Result: works

Comments: This is as expected since the first cursor
locks the record for writing, but allows the second
cursor to read only the same record - makes sense to
me.



*** The problem ***

When I try this:

cursorRef_Csoft=valSQLSelect("SELECT RecID FROM C
WHERE c1='" & c1 & "'", 1, 2, 2);
cursorRef_Csoft=valSQLSelect("SELECT RecID FROM C
WHERE c1='" & c1 & "'", 2, 3, 2);

I get the "cannot set record lock" error. Why? The
first cursor is read only, so why should it prevent
the second cursor from locking the record for writing?
Is this the correct behavior?

Best Regards,
Steven




      Make the switch to the world's best email. Get the new Yahoo!7 Mail now. www.yahoo7.com.au/worldsbestemail




More information about the Valentina mailing list