Add examples for optimistic and pessimistic table locking