There are two types of locking mechanism to prevent data corruption because of more than one user working with the same data.
Optimistic Locking – Locking the record only when update is taking place
Pessimistic Locking – Locking the record from the select to read, update and commit phase.
Apart from that some DBMS systems provide locking mechanism to lock single row, table or database.