Optimistic locking vs pessimistic locking