JPA optimistic lock example.