Set multilock is ON. Otherwise, cursorsetprop( 'Buffering', 5 ) will
give error message.
I'm suspecting that lock() tries to lock related databases. Some of them
may be in eof position, for some even temporary flock() may be placed.
However, in my knowledge, lock() will not lock other than current temporary
table.
Also, maybe this temporary cursor gets locked by some other datasession.
But I have no idea what happens.
>Seems like it should lock OK to me too.
>
>The only thing that comes to mind is SET MULTILOCKS ON.
>
>Good luck,
>
>Jim Nelson
>
>
>>I have a forms with private data session.
>>
>>Cursors are created in those forms load event with optimistics table buffering.
>>
>>
>>create cursor TEMPCURS from array aStru
>>cursorsetprop( 'Buffering', 5 )
>>
>>
>>Forms have a grid (invoice rows) based on this cursor.
>>This cursor has many relations to tables in LAN server set by SET RELATION command in grid column combobox init event.
>>There are a number of users in network and a number of forms in screen using
>>the same program.
>>
>>I have a command
>>SET REPROCESS TO 30 SECONDS
>>
>>in datasesson init.
>>
>>Users can add rows to this cursor in grid and over-type combobox column contents.
>>
>>I use the following command to store the entered data
>>
>>
>>SELECT TEMPCURS
>>IF LOCK()
>> REPLACE mydata with relalias.myvalue
>> unlock
>> else
>> messagebox('Lock Fails !!!' + str(recno()) )
>> endif
>>
>>
>>Locking a temporary cursor must be always successful.
>>However, sometimes users get Lock Fail errors and recno() is -2
>>
>>Why LOCK() command fails in this situation sometimes?
Andrus