Icon View Incident Report

Serious Serious
Reported By: Michael Eubanks
Reported On: 10/10/2002
For: Version 3.17 Build 1
# 1240 Record Locks Causing Read Locks to be Held Too Long and Results in Apparent Deadlock

We have a customer who is running fairly large family entertainment center with our POS software. The facility contains an arcade, full service restaurant, bowling ally, skating rink, snack bar, gift shop, and 12 screen movie theater. They may have up to 30 workstations running at the same time. The problem is that during peek usage time (Saturday night at 7 p.m. and 9 p.m.) the processing response of the all workstations start getting slower and slower. Ultimately the all of the workstations freeze and they have to reboot the server and everything works ok. We had the facility manager monitor memory consumption in DbAdmin and everything looked normal. One odd thing is that when the workstations where slowing down the CPU and disk activity on the server would decrease from about 10-12% to almost 0%. One of the workstations gave a "Record Locked by another user" error before the facility locked up. We never receive this error because we use a high lock time out setting in the session component.
The server is Windows NT 4.0 (I assume with latest SP), Windows 98 SE workstations, Delphi 6 (sp2), DBISAM C/S Version 3.10.

Comments Comments
The problem was that DBISAM was unnecessarily placing a read lock before a record lock and this was causing a race condition:

Client1 Locks record for editing
Client2 Puts a read lock on table before attempting record lock on same
Client1 Tries to post but write lock fails due to read lock on table
Client2 Tries to lock record that is already locked by Client1

Repeat....until Client2's record lock times out. With high retry count and wait time settings it would appear frozen. And if you had an automatic retry in the OnEditError event handler it would go on forever.

Resolution Resolution
Fixed Problem on 10/12/2002 in version 3.18 build 1