Hi,
I've got a problem with the contains method of the Session class. It seems it's not working at all.
Code:
org.hibernate.Session hibsession = HibernateUtil.getCurrentSession();
hibsession.beginTransaction();
Instruction in = (Instruction)session.getAttribute("instr");
if(hibsession.contains(in))
hibsession.merge(in);
else
hibsession.saveOrUpdate(in);
This code always throws an exception telling me the object already exists in this session. The stacktrace shows that saveOrUpdate was called and not merge.
Anybody seen this before or knows what I might do wrong?
Andreas