Exception: Illegal attempt to associate a collection with two open sessions
Bonjour,
J'ai un objet "Dossier" qui est lié - entre autre - à deux autres objets en relation one-to-many
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.xxx.beans">
<class name="Dossier" table="DOSSIERS">
<id name="code" type="int" column="ID_DOSSIER">
</id>
<property name="Description" column="DESCRIPTION" type="string"
not-null="true" />
<property name="DateActivation" column="DATE_ACT" type="date"
not-null="true" length="7" />
<property name="DateDesactivation" column="DATE_DES" type="date"
not-null="false" length="7" />
<property name="Type" column="TYPE" type="string"
not-null="true" length="3" />
<property name="Proprietaire" column="ACTEUR" type="string"
not-null="true" length="50" />
<many-to-one name="EtatDossier" column="FK_ID_ETAT_DOSSIER"
class="EtatDossier" not-null="true" lazy="false">
</many-to-one>
<set name="ListeDemandeModifValeur" table="DEMANDE_MODIF_VALEUR"
inverse="true" lazy="false">
<key column="FK_DOSSIER" />
<one-to-many class="DemandeModifValeur" />
</set>
<set name="ListeDemandeModif" table="DEMANDE_MODIF"
inverse="true" lazy="false">
<key column="FK_DOSSIER" />
<one-to-many class="DemandeModification" />
</set>
</class>
</hibernate-mapping> |
mais quand j'appelle un update de mon DAO
Code:
1 2 3 4 5
|
public void updateDossier(Dossier dossier){
getHibernateTemplate().update(dossier);
} |
j'ai l'exception suivante
Code:
1 2
|
Illegal attempt to associate a collection with two open sessions |
Any Help please!