Bonjour
Un problème de persistance avec Hibernate indiquant l'exception suivante
Exception : Illegal attempt to associate a collection with two open sessions
la ligne de code qui provoque l'exception est en "ROUGE":
public void persist(Domaine transientInstance) {
log.debug("persisting Domaine instance");
Session session = getSession();
Transaction tx = session.beginTransaction();
try {
session.saveOrUpdate(transientInstance);
tx.commit();
log.debug("persist successful");
} catch (RuntimeException re) {
log.error("persist failed", re);
tx.rollback();
throw re;
} finally {
session.close();
}
}
Partager