Kunal Lakhani wrote:Hemant Thard, it works. Thanks.
But, i really don't know why the code given by me doesn't works.
The reason is that you cannot have 2 different object having same identifier in hibernate persistence context.
This is what the exception tells you.
NonUniqueObjectException: a different object with the same identifier value was already associated with the session: