another object with the same id was already associated with the session: [geral.cadastros.cidade.vo.Cidade#4]
Esse foi o erro ao tentar excluir um objeto.
another object with the same id was already associated with the session: [geral.cadastros.cidade.vo.Cidade#4]
Esse foi o erro ao tentar excluir um objeto.
FAQ do Hibernate.
Hibernate throws: Another object was associated with this idFor a particular session, there may be at most one object that represents a particular database row. So, if you already loaded an object with a particular identifier, you can’t then try to associate a different object with the same identifier by calling update().
If you absolutely must do this, evict() the original instance first - but it is much better to simply avoid this situation.
O Hibernate faz cache, veja se já nao existe um objeto com o mesmo id no cache da session. Veja os metodos session.contais(obj) e session.evict(obj) …