1. Entity is just created and JPA does not know anything about it, so comparing by identity is ok
2. Entity was attached and became detached eventually. Presumably, is has irrelevant data, so it's anyway dangerous to deal with them, unless you are going to merge it.