Microsoft Jet Locks

Microsoft Jet uses two categories of locks: shared locks and exclusive locks. These locks are used internally by Microsoft Jet and should not be confused with the types of locks that you apply to data in your application through Visual Basic code. Each extended byte range lock (with the exception of user locks) represents a page in the .mdb file. However, no data is physically locked in the .mdb file.

A shared lock occupies only 1 byte and never conflicts with another shared lock. Shared locks are typically used to allow more than one person to read data from a file at the same time.

Exclusive locks span between 256 and 512 bytes and, by their nature, always conflict with other shared and exclusive locks. The exclusive lock always locks the first 256 bytes of the extended byte range lock to prevent any shared locks from being set and to determine if any shared locks exist. In addition, extended locks lock enough additional bytes to determine which user is holding the lock. For example, when a user wants to open a table in deny-read mode, Microsoft Jet tries to place an exclusive lock. This exclusive lock would be prevented if another user had a shared lock on the table. If the exclusive lock succeeded, it would prevent other users from obtaining a shared lock.