fix #1111 Updating entity results in error 'This identifier already exists. It must be unique'