Consider the following scenario (it is contrived to highlight the potential issue):

I have a backend.accdb MS Access DB that contains all data tables. Let's consider this to be an address contacts list, with at least a table of contacts with a primary key on ContactsTable.Id. I also have two client MS Access files, each with reports and forms that query backend.accdb. How do I avoid data entry read-write overlap concurrency issues (analogous to multiple threads accessing program shared variables)?

i.e. i) each client queries backend.ContactsTable for the same entry as specified by ContactsTable.Id. ii) Each client takes the current value of a field SeenCount for this entry and increments it.

It is possible for both clients to read the same value and increment it, however the value should have been incremented twice.

How do I avoid such concurrency issues and what is best practice?

  • Look into optimistic or pessimistic locking. – Colin 't Hart Apr 11 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.