JPA example with optimistic lock