Hi,
I like to load an entity from one database and then insert it into another database.
I created 2 sessions (session and sessionbuffer).
I load an entity from session.
Then I make this entity persistent in sessionbuffer.
But that don't work, because of this message:
Quote:
object already associated with session: ....
I thought that my entity was a POJO, so this could just be done:
Code:
...
Criteria criteria = session.createCriteria(Probprod.class).add(
Restrictions.eq("bundnr1", bundnr1)).addOrder(
Property.forName("enddat").desc());
....
Transaction tx = sessionBuffer.beginTransaction();
sessionBuffer.persist(criteria.list().get(0));
...
tx.commit();
....
Is there a correct and easy way of doing this???
Thanx in advance,
Marcel