EXCEPTION :
net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: com.psadirect.hibernate.CallPK@7d32cf[callId=3,subscriber=com.psadirect.hibernate.Subscriber@86506a[subscriberId=1]], of class: com.psadirect.hibernate.Call
-----------
I have a collection. I take out each item from the collection, do :
while (collection.hasNext()) {
item i = (item) collection.next();
i.setXXX(xxx);
session.update(i);
}
This fails with the above exception (NonUniqueObjectException).
Can someone tell me how to achieve what I want to do without getting this exception ?
Thanks,
SC
|