Record Locking

Record-locking issues require careful consideration in wireless operations. Business applications rely heavily on record locking to ensure consistent data quality and to guard against conflicting updates by multiple users, a concept known as concurrency. Unreliable wireless connections can complicate record-locking issues. Mobile solutions may generally support three types of concurrency–destructive, optimistic, or pessimistic concurrency.

With destructive concurrency, the last update to a record "wins." The application does not attempt to settle any update conflicts, giving it no control over data updates. This situation can leave your data in an inconsistent state if updates aren't completed in the correct order.

Optimistic concurrency assumes that no data update conflicts exist. When a user updates a data record, the original record is checked to see if it has changed since the user accessed the record. If a conflict is detected, the user is given the option to overwrite the record. If no change is detected, the record is overwritten.

Pessimistic concurrency is probably the most familiar version of record locking. This concept assumes a high probability of data update conflict. A record selected for update remains locked until the user writes the update to the database. Accomplishing this form of concurrency with desktop network systems is relatively straightforward. For a mobile application, the process is a bit more complicated. In a mobile environment, we accomplish this by having the application maintain lock information in individual records or in a lock table. This solution is not foolproof. If the data is also available via ODBC or another data source, these locks do not prevent other users from accessing and updating data.