posted 19 years ago
Hi Daming,
Don't worry about locking at the record level for each record, lock the whole list. The other threads can wait to read while you update a record. Locking at the record level is not necessary, so somehing like this, in the DB class, or the implementor:
I locked each record at the record level, and had a queue on the lists, and I lost marks, so keep it simple. Lock the whole list, modify, then unlock, simple. You don't have to have bullet proof code like DB2, and efficiency you don't have to worry about.
Hope this helps.
Michael