One type of lock is the optimistic lock at row level.
An update operation performed by the current user on a row on which this user has set an optimistic lock is only actually performed if this row has not been changed in the meantime by a concurrent transaction. If a concurrent transaction has changed the row, then the change operations of the current user are rejected. The optimistic lock is released again in both cases.
If the update operation was successful, an exclusive lock is set for this row. If the update operation was not successful, it should be repeated after reading the row again with or without optimistic lock. In isolation level 0, an explicit lock must be specified for the new read operation. In this way, it can be ensured that the update is done to the current state and that no modifications made in the meantime are lost.
It only makes sense to use an optimistic lock if one of the isolation levels 0, 1 or 10, or 15 has been assigned. An optimistic row lock must be explicitly requested by specifying a LOCK statement. A request can conflict with an exclusive lock only. Concurrent transactions do not collide with an optimistic lock.