I am facing a peculiar problem while saving the data. Below is the detailed explanation what I am doing. I always get the problem as "a different object with the same identifier value was already associated with the session"

But the above error does not come when I try to save the same object from java.