A method of controlling file access in a multiuser environment, where there is always a possibility that two users will attempt to update the same file at the same time but with different information. The first user to access the file locks out all the other users, preventing them from opening the file. After the file is updated and closed again, the next user can gain access.
File locking is a simple way to prevent simultaneous updates, but it can seriously degrade system performance if many users attempt to access the same files time after time. To prevent this slowdown, many database management systems use record locking instead. Record locking limits access to individual records within the database file.