Extracted out repository pessimistic locking
Added or adjusted logging in various components