I am working in a web app with Spring/Hibernate. I am getting the exception NonUniqueObjectException when i try to update my Account Object.
I am using Spring-Hibernate Template and i have written my DAO and tested it.
What i do is - user has to type the email id of an account and if that exists it will show the other details of that account like username, password, email etc.
When user do some changes in the the name,address or password and click the save button the same object has to be saved or updated.
Inorder to Check whether the operation is save or update, i am passing the PK (accountId) while updating the object.
Code is given below (Controller part):-
the high-lighted code is the problem area.
can anyone suggest me where i am doing the mistake.
thanks in advance