Hi!
I have one object, which I want to insert twice into the same table.
This is requiered for keeping a history.
The inserts should happen within in the same transaction.
And look something like
Code:
...
session = HibernateUtil.currentSession();
transaction = session.beginTransaction();
TObject o = new TObject();
....
session.save(o);
o.setValue(v);
session.save(o);
transaction.commit();
...
finally{
session.close();
}
Unfortunately Hibernate thinks, that it has to perform an UPDATE on the second time calling session.save(o) and does not insert o again. These
seems to make session.update and session.saveOrUpdate redundant.
In a second try I have tried to clone o and then save the clone, but with the same result. Who can help?
thx in advance[/code]