I am running into problems updating an object
2004-07-12 16:39:39,923 ERROR SchedulesUpdAction.doWork(SchedulesUpdAction.java:108) : a different object with the same identifier value was already associated with the session: 402, of class: com.qas.newmedia.intranet.iq.dto.schedules.DataAcquisitionSchedule
This is where I have used HibernateUtil which only ever creates one session as far as I can see and uses an internal ThreadLocal to manage it. Therefore because I use load my object out of this session and later return to save it I get this error.
My question is should I not use HibernateUtil? Should I just create new sessions each time I need to do something? Or should I reload my object first, overwrite the relevant fields with the updated values and then resave?
Thanks!
|