Hi,
I'm facing a problem with Hibernate 3.2.1 GA tied with Spring framework. I think the problem is due to how I use Hibernate.
1- I load an object A (Class C id 1) through a Hibernate Session.
2- I store object A in memory.
3- In a transaction, I open a new Hibernate Session
4- In this Hibernate Session, I load a lof of objects including a similar object than A (Class C id 1).
5- After some operations, I want to saveOrUpdate object A referenced in step 1 : Hibernate throw an exception :
a different object with the same identifier value was already associated with the session: [com.mycompany.mypackage.MyClass#1]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.mycompany.mypackage.MyClass#1]
What's wrong ? How can I solve this problem ?
Thanks a lot !
Regards,
E. Lewandowski
|