Icon View Incident Report

Serious Serious
Reported By: Davide Moretti
Reported On: 3/8/1999
For: Version 1.12 Build 1
# 324 Re-Entrance Possible During Record Lock Wait Due to ProcessMessages Call

Look at this: there are two datasets pointing to the same table (I need this for a program that makes async access to a table based on TCP/IP messages it receives and one can also change manually data in that table in another form... I got strage results until I discovered this...): each dataset here is connected to a grid. If you place a record into Edit state (just editing a row in one of the grids), and try to edit the same record in the other grid, you get the error #10258, this is obviously correct since the record is locked.
BUT if you try to edit two or more times the record before the lock timeout occours, you get error #10242 and an Access Violation!!!
Also, the RecordIsLocked function does not report records locked by other
datasets (or other users) i.e pressing the Button1 the program scans all
records using the Dataset2 and calls RecordIsLocked for each one; if you
lock a record using the other dataset it won't be reported.

I found that RecordIsLocked returns true only if you call Edit from the same

Comments Comments
The problem was with the lock wait logic - an Application.ProcessMessages was being called during the wait which would allow the DBGrid to respond to window messages and attempt to edit and lock the record again during the wait time. The result was that DBISAM would be re-entered illegally and all sorts of things would occur.

Resolution Resolution
Fixed Problem on 3/7/1999 in version 1.13 build 1