In pessimistic locking approach an entity is locked for the entire time the entity is in application memory (often in the form of an object). A read lock indicates that the object can be read but not modified or deleted by the other transactions. A write lock indicates that the object is locked exclusively and only the current transaction can read, modify or delete the object.
Advantage: pessimistic locking is easy to implement and guarantees that your changes to the database are made consistently and safely.
Disadvantage: pessimistic locking is not scalable; in systems with many users or long-running transactions, the waiting time for a lock to be released can be too long.