added note and example code about pessimistic locking