Microsoft Jet provides data-sharing services that enable multiple users to access and change a shared database. Microsoft Jet locks all data in the 2 KB pages, even if the user is only retrieving or manipulating some of the records on those pages. When a database resides on a file server, Microsoft Jet uses the underlying network operating system’s basic locking techniques to lock pages when a table record is being modified.
Microsoft Jet supports pessimistic and optimistic record locking. Pessimistic locking locks the page that contains the record being edited as soon as the editing begins. The page is unlocked when editing is completed. No two users can edit data on the same locked page at the same time. Optimistic locking locks the page that contains the record being edited only when the editing is committed. In this scenario, two users can edit the same record at the same time, but a trappable run-time error occurs when a user attempts to save changes after the other user has saved changes to the record.
To coordinate locking in a multiuser environment, Microsoft Jet uses a locking information file (by using the same file name as the database but with an .ldb extension) that is stored in the same directory as the database itself. Each user who opens the database generates an entry in this file. This list of current users is used to determine which records in a database are locked and who has them locked. This system is designed to prevent possible file-contention errors and to avoid data corruption. The .ldb file is created when you open a database for shared access and is deleted after the last user closes the database.