I have an object that was loaded, serialized and unserialized. When I try to update it (using the same session that loaded it), I get this error:
Quote:
net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 1, of class: com.agentscape.associate.to.ServerInfoTO
at net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:1673)
at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:1442)
at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1469)
at net.sf.hibernate.impl.SessionImpl.update(SessionImpl.java:1354)
at com.agentscape.associate.bo.BaseBO.update(BaseBO.java:45)
at com.agentscape.associate.test.SerializableTest.doLoad(SerializableTest.java:61)
at com.agentscape.associate.test.SerializableTest.<init>(SerializableTest.java:21)
at com.agentscape.associate.test.SerializableTest.main(SerializableTest.java:69)
Is it a "bad thing" to update an object that was serialized / unserialized? If I comment out the serialize / unserialize part, the update works great.
I can post an example if needed.
I'm using Hibernate 2.1.4 with MySQL 4.0.20a.
Thanks in advance,
Jesse