supported optimistic lock with versioning for entity