Record Locking

ted.martin

Registered User.
Local time
Today, 09:26
Joined
Sep 24, 2004
Messages
743
I hope someone can help.

When using Record Locking in Access 2007 where the database has been split to both a Back-End tables and Front-End forms/modules etc., does the Edited Record tick in Access Options/Advanced need to be on just the Back-End tables or Back-End and Front-End or just the Front-End?

Many thanks

:rolleyes:
 
i don't know without looking carefully - but I do think active record locking is generally not required except in exceptional circumstances - and if you are having to ask, you do not need active record locking.

try it without. you won't have a problem, I am sure.

no record-locking doesn't actually mean no record locking, incidentally. access uses something called optimistic record locking, which is adequate 99.9% of the time
 
Thanks for your reply; at least you did. An interesting concept which leads to the question why has MS provided this facility if it not needed.

My app is commercial so I need to give it as much rigour as possible

Thankx
 
OK. data control needs to distingusih between writing records and reading records

record locking is intended to manage a situation with multiple writers.

unlimited numbers of users can read records simultaneously , because they are not changing the records. the problem only comes with writing changes

if two writers both try and write a record (or a series of records) together then there are 2 main problems

1. inconsistent updates.
if two people are changing data, then a problem arises. user1 reads the records changes it, and puts it back. user2 does the same thing. the db system needs to ensure that either user1 completes his process before user2 starts, or vice versa

one way of doing this is for either user1 or user2 to actively lock the record when they use it, and release the lock when they are finished.

however a problem with actively managed locks is that the programmer has to manually obtain and release the locks, and manage the timing of this process. it's no good locking a record, or a whole file, and then leaving the application as this can be very negative for other users

2. deadly embrace

this is a situation, where two processes conflict. processA needs to lock certain records. processB needs to lock the same records. now if processA locks 1 record, and processB locks another, then each process gets stuck waiting for the other. the programmer needs to manage the process of releasing locks already obtained after a certain time, and trying again.


3. transaction processing.

some of this is at the back of "transaction" processing. in a transaction a WHOLE series of actions needs to be completed or the whole series has to be unravelled

4. page size issues

page/cluster locks. one issue with locks is that access cannot necessarily just lock a single record. in some cases it has to lock a "page" of data which might include the required record, and other records taking up the same data storage area.

all this means that locking records is not something to consider lightly. the programmer has to code very carefully when using an active locking strategy, and generally it would only be necessary in quite specialised situations.


optimistic locking

however, you may think that having no locking is not desirable either. in fact, the default mechanism in access is something called optimistic record locking. in this case, access does not actually lock the records at all, but before writing changes, it re-reads the record to ensure it did not change in the meantime. if it did it notifies the user that his changes have failed, and allows him to take another option. by working this way, processes trying to read records are never inconvenienced by finiding locked records, and this procedure generally gives satisfactory performance.

hope this helps
 

Users who are viewing this thread

Back
Top Bottom