vendredi 8 avril 2016

How to avoid "a different object with the same id.."?

I am using:

  • Web App (a filter opens session. DAO uses getCurrentSession())
  • Hibernate
  • Spring (AOP configuration over Service)
  • xml configuration for all
  • DTO between Mbean and Service

Well, I have two methods (business service):

  • service.findUser(..DTO..)
  • service.updateUser(..DTO..)

update throws org.hibernate.NonUniqueObjectException exception. How can I avoid that? I need to use update, not merge.

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire